SVNBOOK Chap4 Branching and Merging Using Branches Working with Your Branch
De Framalang Wiki.
Cette page fait partie du projet Version control with subversion.
| Pseudo | Code | Rôle | Statut |
|---|---|---|---|
| Sub Versif | SVF | Traduction | Terminé |
| Hotshot92 | Relecture | Terminé | |
| Validation |
Source: http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.using.work
Sommaire |
Titre
Paragraphe 1
Now that you've created a branch of the project, you can check out a new working copy to start using it:
$ svn checkout http://svn.example.com/repos/calc/branches/my-calc-branch A my-calc-branch/Makefile A my-calc-branch/integer.c A my-calc-branch/button.c Checked out revision 341.
$ svn checkout http://svn.exemple.com/depot/calc/branches/ma-branche-calc A ma-branche-calc/Makefile A ma-branche-calc/entier.c A ma-branche-calc/bouton.c Révision 341 extraite.
Paragraphe 2
Paragraphe 3
Let's pretend that a week goes by, and the following commits happen:
* You make a change to /calc/branches/my-calc-branch/button.c, which creates revision 342. * You make a change to /calc/branches/my-calc-branch/integer.c, which creates revision 343. * Sally makes a change to /calc/trunk/integer.c, which creates revision 344.
Now two independent lines of development (shown in Figure 4.4, "The branching of one file's history") are happening on integer.c.
Imaginons qu'une semaine se passe, et que les livraisons suivantes ont lieu:
* Vous modifiez /calc/branches/ma-branche-calc/bouton.c, ce qui crée la révision 342. * Vous modifiez /calc/branches/ma-branche-calc/entier.c, ce qui crée la révision 343. * Sally modifie /calc/trunk/entier.c, ce qui crée la révision 344.A présent, deux lignes de développement indépendantes (voir la Figure 4.4, "Historique des branches d'un fichier") existent pour entier.c.
Paragraphe 4
Things get interesting when you look at the history of changes made to your copy of integer.c:
$ pwd
/home/user/my-calc-branch
$ svn log -v integer.c
------------------------------------------------------------------------
r343 | user | 2002-11-07 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 lines
Changed paths:
M /calc/branches/my-calc-branch/integer.c
* integer.c: frozzled the wazjub.
------------------------------------------------------------------------
r341 | user | 2002-11-03 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 lines
Changed paths:
A /calc/branches/my-calc-branch (from /calc/trunk:340)
Creating a private branch of /calc/trunk.
------------------------------------------------------------------------
r303 | sally | 2002-10-29 21:14:35 -0600 (Tue, 29 Oct 2002) | 2 lines
Changed paths:
M /calc/trunk/integer.c
* integer.c: changed a docstring.
------------------------------------------------------------------------
r98 | sally | 2002-02-22 15:35:29 -0600 (Fri, 22 Feb 2002) | 2 lines
Changed paths:
A /calc/trunk/integer.c
* integer.c: adding this file to the project.
------------------------------------------------------------------------
Les choses deviennent intéressantes quand vous regardez l'historique des modifications apportées à votre copie de entier.c :
$ pwd
/home/utilisateur/ma-branche-calc
$ svn log -v entier.c
------------------------------------------------------------------------
r343 | utilisateur | 2002-11-07 15:27:56 -0600 (jeu. 07 nov. 2002) | 2 lines
Chemins modifiés :
M /calc/branches/ma-branche-calc/entier.c
* entier.c: machiné le bidule.
------------------------------------------------------------------------
r341 | utilisateur | 2002-11-03 15:27:56 -0600 (jeu. 07 nov. 2002) | 2 lines
Chemins modifiés :
A /calc/branches/ma-branche-calc (from /calc/trunk:340)
Création d'une branche privée à partir de /calc/trunk.
------------------------------------------------------------------------
r303 | sally | 2002-10-29 21:14:35 -0600 (mar. 29 oct. 2002) | 2 lines
Chemins modifiés :
M /calc/trunk/entier.c
* entier.c: modifié une docstring.
------------------------------------------------------------------------
r98 | sally | 2002-02-22 15:35:29 -0600 (ven. 22 fev. 2002) | 2 lines
Chemins modifiés :
A /calc/trunk/entier.c
* entier.c: ajout du fichier dans ce projet.
------------------------------------------------------------------------ Paragraphe 5
Notice that Subversion is tracing the history of your branch's integer.c all the way back through time, even traversing the point where it was copied. It shows the creation of the branch as an event in the history, because integer.c was implicitly copied when all of /calc/trunk/ was copied. Now look at what happens when Sally runs the same command on her copy of the file:
$ pwd
/home/sally/calc
$ svn log -v integer.c
------------------------------------------------------------------------
r344 | sally | 2002-11-07 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 lines
Changed paths:
M /calc/trunk/integer.c
* integer.c: fix a bunch of spelling errors.
------------------------------------------------------------------------
r303 | sally | 2002-10-29 21:14:35 -0600 (Tue, 29 Oct 2002) | 2 lines
Changed paths:
M /calc/trunk/integer.c
* integer.c: changed a docstring.
------------------------------------------------------------------------
r98 | sally | 2002-02-22 15:35:29 -0600 (Fri, 22 Feb 2002) | 2 lines
Changed paths:
A /calc/trunk/integer.c
* integer.c: adding this file to the project.
------------------------------------------------------------------------Notez bien que Subversion reprend tout l'historique du entier.c de votre branche à travers le temps, remontant même jusqu'au point où il a été copié. Il liste la création d'une branche en tant qu'élément de l'historique, parce qu'entier.c a été copié implicitement lorsque calc/trunk tout entier a été copié. Maintenant regardez ce qui se passe quand Sally lance la même commande sur sa copie du fichier :
$ pwd
/home/sally/calc
$ svn log -v entier.c
------------------------------------------------------------------------
r344 | sally | 2002-11-07 15:27:56 -0600 (jeu. 07 nov. 2002) | 2 lines
Chemins modifiés :
M /calc/trunk/entier.c
* entier.c: corrigé un ensemble de coquilles.
------------------------------------------------------------------------
r303 | sally | 2002-10-29 21:14:35 -0600 (mar. 29 oct. 2002) | 2 lines
Chemins modifiés :
M /calc/trunk/entier.c
* entier.c: modifié une docstring.
------------------------------------------------------------------------
r98 | sally | 2002-02-22 15:35:29 -0600 (ven. 22 fev. 2002) | 2 lines
Chemins modifiés :
A /calc/trunk/entier.c
* entier.c: ajout du fichier dans ce projet.
------------------------------------------------------------------------
