Patch Fájl Használata

Indította Action, 2010 július 19, 09:54:07 DÉLUTÁN

Előző téma - Következő téma

Action

Egy patch fájl nagyon sokszor óvhat meg minket lépések hosszú sorától ezért nem árt ismerni a használatát.

A valami.patch fájlt bemásolod akárhová, legyen most ez a C:\TCPATCH mappa.

Ezután belépsz a letöltött repository mappájába a TrinityCore-nak, oda ahol a makefile is van.

És egy nagyon egyszerű parancsot kiadsz command promptban (futtatás/cmd vagy totalcommanderben ha adott mappában állsz csak cmd, vagy a parancssorba):


hg import C:\TCPATCH\valami.patch

Ha eleve a repository gyökérbe teszed a patch fájlt akkor:


hg import valami.patch


A leírást Ident készítette !
A WORD elszáll, az írás megmarad.

piti629hun

hali . nekem nem mükszik :S ez írja : abort : outstanding uncommitted changes

Skyne

hg import C:\TCPATCH\valami.patch -f --no-commit

NevemSenki

Hát ez a Topic a Patch Fájl Használatáról szól, én kicsit kibővítem.

Patch Fájl Készítéséről lenne egy kérdésem.

Patch fájlt már tudunk feltenni, de miként készítik? Keresgéltem Google-n, de nem találtam konkértan rá a dologra.

Az addig ok, hogy " + " jelekkel adok hozzá és a " - " jelekkel törlök bizonyos fájlokból, aminek ugye előtte a konkrét elérési útját is le kell írni.
De ezt viszont nem értem ( Példa ):

Idézdiff -r ccc441794de0 contrib/extractor/loadlib/wdt.cpp
    --- a/contrib/extractor/loadlib/wdt.cpp   Tue Jul 14 01:04:19 2009 +0200
    +++ b/contrib/extractor/loadlib/wdt.cpp   Mon Jul 13 22:54:14 2009 -0400
    -58,5 +58,9 @@

Ezek az értékek mit jelképeznek? Miért vannak benne?
Milyen módon esetleg programmal készítik?
Ha ezek készítésére van konkrét program, annak mi a neve?

Azért érdekel ez engem annyira, mert ugye sok mindent vissza kell pakolászni, ha az ember Rev.-et cserél, és ha egybeírnánk egy párat, csinálnánk 1-2-3 DB Patch fájlt, már könnyebb lenne a dolgunk. )

Üdv.: Senki

drestor

Linux alappú rendszereken:

Idézpatch -p1 < fájlnév

$0undX

amit drestor említett az windows-on is megy cmdből vagy git bash-ből.

ident

Vagy:

hg diff

Utána pedig újra importálni.
Fhatys, a sors által kirótt, elkerülhetetlen feladat szava.
http://eu.battle.net/wow/en/character/arathor/Ident/advanced

NevemSenki

#7
IdézCreating and Applying Patches

For open source projects (like this one) everyone has read access to the repository, and anyone can make a contribution to the project. So how are those contributions controlled? If just anyone could commit changes, the project would be permanently unstable and probably permanently broken. In this situation the change is managed by submitting a patch file to the development team, who do have write access. They can review the patch first, and then either submit it to the repository or reject it back to the author.

Patch files are simply Unified-Diff files showing the differences between your working copy and the base revision.
Creating a Patch File

First you need to make and test your changes. Then instead of using TortoiseSVN → Commit... on the parent folder, you select TortoiseSVN → Create Patch...

Figure 4.43. The Create Patch dialog



you can now select the files you want included in the patch, just as you would with a full commit. This will produce a single file containing a summary of all the changes you have made to the selected files since the last update from the repository.

The columns in this dialog can be customized in the same way as the columns in the Check for modifications dialog. Read the section called "Local and Remote Status" for further details.

You can produce separate patches containing changes to different sets of files. Of course, if you create a patch file, make some more changes to the same files and then create another patch, the second patch file will include both sets of changes.

Just save the file using a filename of your choice. Patch files can have any extension you like, but by convention they should use the .patch or .diff extension. You are now ready to submit your patch file.

You can also save the patch to the clipboard instead of to a file. You might want to do this so that you can paste it into an email for review by others. Or if you have two working copies on one machine and you want to transfer changes from one to the other, a patch on the clipboard is a convenient way of doing this.
Applying a Patch File

Patch files are applied to your working copy. This should be done from the same folder level as was used to create the patch. If you are not sure what this is, just look at the first line of the patch file. For example, if the first file being worked on was doc/source/english/chapter1.xml and the first line in the patch file is Index: english/chapter1.xml then you need to apply the patch to the doc/source/ folder. However, provided you are in the correct working copy, if you pick the wrong folder level, TortoiseSVN will notice and suggest the correct level.

In order to apply a patch file to your working copy, you need to have at least read access to the repository. The reason for this is that the merge program must reference the changes back to the revision against which they were made by the remote developer.

From the context menu for that folder, click on TortoiseSVN → Apply Patch... This will bring up a file open dialog allowing you to select the patch file to apply. By default only .patch or .diff files are shown, but you can opt for "All files". If you previously saved a patch to the clipboard, you can use Open from clipboard... in the file open dialog.

Alternatively, if the patch file has a .patch or .diff extension, you can right click on it directly and select TortoiseSVN → Apply Patch.... In this case you will be prompted to enter a working copy location.

These two methods just offer different ways of doing the same thing. With the first method you select the WC and browse to the patch file. With the second you select the patch file and browse to the WC.

Once you have selected the patch file and working copy location, TortoiseMerge runs to merge the changes from the patch file with your working copy. A small window lists the files which have been changed. Double click on each one in turn, review the changes and save the merged files.

The remote developer's patch has now been applied to your working copy, so you need to commit to allow everyone else to access the changes from the repository.

Konkrétan erre gondoltam.

Csak még egy dolog nem tiszta, én a Tc Rev-eket nem SVN-el szedem le.
Hogyan kreálom át a mappát olyanra, mintha SVN-el szedtem volna le?

Mert ha azzal szedem le, és valamit változtatok benne, akkor a modosított fájlon egy piros " ! " jelenik meg, és ha kreálom a Patch-et akkor csak az a módosítás fog szerepelni a Patch-ben.
De viszont ha nem SVN-es a mappám ahol a fájlok találhatóak, akkor hiába módosítok, nem bírok Patch-et kerálni.

Tehát hogy csinálok ilyen kis zöld pipákat?  :D
A felkiáltójel azért van ott mert azt már módosítottam.



Eredeti:

-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.45-community-nt


Módosítás:

-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version /* Salalala... hip hop hep hap */ 5.0.45-community-nt



Patch:

Index: sql/realmd.sql
===================================================================
--- sql/realmd.sql (revision 31)
+++ sql/realmd.sql (working copy)
@@ -1,7 +1,7 @@
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
--- Server version 5.0.45-community-nt
+-- Server version /* Salalala... hip hop hep hap */ 5.0.45-community-nt


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;


Ha valaki tudja a pipás dologra a választ, ne titkolja el.  :D  :D

Üdv.: Senki

Skyne

ahogy ident is mondta hg diff >patch.diff
nem kell ide semmi pipa meg akármi, nincs ebbe varázslat

ident

A felkiáltó jel azért van ott, mivel nem egyezik az svn tartalmával. Ha zöld pipát akarsz akkor saját repóra kell felraknod az egészet és oda commitolnod a változtatásaid és azt letöltened a saját svn-edről.
Fhatys, a sors által kirótt, elkerülhetetlen feladat szava.
http://eu.battle.net/wow/en/character/arathor/Ident/advanced

Kerge

#10
Hali! Tudom xD "Ebbe a témába legalább 120 napja nem írtak."
De nekem gondom lenne a patch filek imporálásával :S Még 1-et sem sikerült importálnim, mert mindíg ezt kapom:


EDIT.:
áááááá :D nem szóltam :D:D ennek ellenére berakta szépen :D



XMas WoW DEV

Powered by EzPortal