[linux-l] Re: VCS

Mike Dornberger Mike.Dornberger at gmx.de
Fr Apr 28 06:53:31 CEST 2006


Hi,

On Wed, Apr 26, 2006 at 02:15:10PM +0200, Volker Grabsch wrote:
> On Wed, Apr 26, 2006 at 11:52:00AM +0200, Frank Reker wrote:
> > >Wie jetzt? Geht das Umbennen von Verzeichnissen nun (einschliesslich
> > >Revisionskontrolle und bei auschecken eines alten Tags ist das
> > >Verzeichnis da, wo es damals war etc) oder nicht?
> 
> Ja, es geht.
> 
> > ja, bei einem kompletten auschecken schon. korrigiert mich jetzt, wenn
> > ich falsch liege,
> 
> Du liegst falsch.

nicht ganz... (siehe unten bei '#####hier')

> > aber ein umbenennen eines verzeichnisses ist wie
> > ein loeschen selbigen mit saemtlichen inhalts und dem neuen
> > einchecken des verzeichnisses mit inhalt. d.h. svn weiss nicht,
> > dass die dateien vorher in einem anderen verzeichniss waren.
> 
> Ich weiß nicht, was schiefgegangen ist, vielleicht wurde das
> Verzeichnis "einfach so" umbenannt, statt mit "svn move".
> 
> Aber mit unsachgemäßer Bedienung kann man jedes SCM stören.
> 
> > d.h. fuer svn sind das zwei dateien, die eine wurde zu einem
> > bestimmten zeitpunkt geloescht, und die andere zum selben zeitpunkt
> > neu angelegt. aber es besteht keine verbindung dieser dateien.
> 
> Ganz falsch. Im Gegenteil, das neue Verzeichnis kennt die komplette
> Geschichte des alten Verzeichnisses. So, wie es sein muss.
> 
> > (gilt auch beim umbenennen oder verschieben einer einzelnen datei.)
> 
> Nein, auch nicht. Bei Dateien genau dasselbe.
> 
> > >Wieso funktioniert das einchecken nicht? Klappt das mergen/einchecken
> > >nur, wenn Verzeichnisse nicht unbenannt wurden?
> > 
> > da svn nicht weiss, dass die datei vorher in einem anderen verzeichnis
> > war, kann es die aenderungen nicht mergen
> 
> Doch, Subversion weiß es, aber man muss es ihm natürlich sagen. (Muss
> man bei Darcs, ... ja genauso)
> 
> siehe: "svn move", "svn copy"

#####hier

Ich habe das folgende (im Anhang) mal mit nem typescript aufgenommen und die
Sonderzeichen rauseditiert. (Dadurch ist bei dem mcedit jew. auch nichts zu
sehen.) Subersiov-Version: Debian Sarge 1.1.4-2

Weil es vielleicht unübersichtlich ist, hier die Änderungen an den Dateien
abc und xyz:

in wc1 @ r1:
cat def 
abc
cat xyz
123

in wc2 @ r2:
cat def
123
abc
cat xyz
abc
123

in wc1 vor update:
cat test1/def
abc
456
cat test2/xyz
123
ghi

in wc1 nach update/merge:
cat test1/def
abc
456
cat test1.moved/def
123
abc
cat test2/xyz
abc
123
ghi

Vielleicht wird das ja mittlerweile richtig gehandhabt, aber da wohl Sarge
noch eine Weile bestehen bleibt, kann man davon ausgehen, daß auch viele
noch die entsprechende Version nutzen werden.

Gruß,
 Mike
-------------- nächster Teil --------------
user:~$ cd temp
user:~/temp$ mkdir svnrepotest
user:~/temp$ cd svnrepotest
user:~/temp/svnrepotest$ mkdir repo wc1 wc2
user:~/temp/svnrepotest$ svnadmin create --fs-type fsfs repo/repo
user:~/temp/svnrepotest$ cd wc1
user:~/temp/svnrepotest/wc1$ svn checkout file:///home/user/temp/svnrepotest/repo/repo/ .


Checked out revision 0.
user:~/temp/svnrepotest/wc1$ mkdir -p mymodule/test1 mymodule/test2
user:~/temp/svnrepotest/wc1$ echo abc >mymodule/test1/def
user:~/temp/svnrepotest/wc1$ echo 123 >mymodule/test2/xyz
user:~/temp/svnrepotest/wc1$ svn add mymodule/
A         mymodule
A         mymodule/test1
A         mymodule/test1/def
A         mymodule/test2
A         mymodule/test2/xyz
user:~/temp/svnrepotest/wc1$ svn commit -m 'adding mymodule + some project files'
Adding         mymodule
Adding         mymodule/test1
Adding         mymodule/test1/def
Adding         mymodule/test2
Adding         mymodule/test2/xyz
Transmitting file data ..
Committed revision 1.
user:~/temp/svnrepotest/wc1$ svn status -v
                0        0  ?           .
                1        1 furrywolf    mymodule
                1        1 furrywolf    mymodule/test1
                1        1 furrywolf    mymodule/test1/def
                1        1 furrywolf    mymodule/test2
                1        1 furrywolf    mymodule/test2/xyz
user:~/temp/svnrepotest/wc1$ cd mymodule/
user:~/temp/svnrepotest/wc1/mymodule$ ls
test1  test2
user:~/temp/svnrepotest/wc1/mymodule$ svn status 
user:~/temp/svnrepotest/wc1/mymodule$ pushd ../../wc2
~/temp/svnrepotest/wc2 ~/temp/svnrepotest/wc1/mymodule
user:~/temp/svnrepotest/wc2$ svn checkout file:///home/user/temp/svnrepotest/repo/repo/mymodule .
A  test1
A  test1/def
A  test2
A  test2/xyz
Checked out revision 1.
user:~/temp/svnrepotest/wc2$ cd test2/
user:~/temp/svnrepotest/wc2/test2$ mcedit xyz 
user:~/temp/svnrepotest/wc2/test2$ cd ../test1/
user:~/temp/svnrepotest/wc2/test1$ mcedit def 
user:~/temp/svnrepotest/wc2/test1$ cd ..
user:~/temp/svnrepotest/wc2$ ls
test1  test2
user:~/temp/svnrepotest/wc2$ svn move test1/ test1.moved
svn: Use --force to override this restriction
svn: Move will not be attempted unless forced
svn: 'test1/def' has local modifications
user:~/temp/svnrepotest/wc2$ cat test1/def 
123
abc
user:~/temp/svnrepotest/wc2$ svn revert test1/def
Reverted 'test1/def'
user:~/temp/svnrepotest/wc2$ svn move test1/ test1.moved
A         test1.moved
D         test1/def
D         test1
user:~/temp/svnrepotest/wc2$ mcedit test1.moved/def 
user:~/temp/svnrepotest/wc2$ cat test1.moved/def
123
abc
user:~/temp/svnrepotest/wc2$ cat test2/xyz 
abc
123
user:~/temp/svnrepotest/wc2$ svn commit -m 'moving dir + changing files'
Deleting       test1
Adding         test1.moved
Sending        test1.moved/def
Sending        test2/xyz
Transmitting file data ..
Committed revision 2.
user:~/temp/svnrepotest/wc2$ dirs
~/temp/svnrepotest/wc2 ~/temp/svnrepotest/wc1/mymodule
user:~/temp/svnrepotest/wc2$ pushd -0
~/temp/svnrepotest/wc1/mymodule ~/temp/svnrepotest/wc2
user:~/temp/svnrepotest/wc1/mymodule$ ls
test1  test2
user:~/temp/svnrepotest/wc1/mymodule$ mcedit test2/xyz 
user:~/temp/svnrepotest/wc1/mymodule$ mcedit test1/def 
user:~/temp/svnrepotest/wc1/mymodule$ cat test1/def
abc
456
user:~/temp/svnrepotest/wc1/mymodule$ cat test2/xyz 
123
ghi
user:~/temp/svnrepotest/wc1/mymodule$ svn commit -m 'changing some files' #this should fail
svn: Commit failed (details follow):
svn: Out of date: '/mymodule/test1' in transaction '2-1'
user:~/temp/svnrepotest/wc1/mymodule$ svn update 
G  test2/xyz
A  test1.moved
A  test1.moved/def
D  test1
Updated to revision 2.
user:~/temp/svnrepotest/wc1/mymodule$ ls
test1  test1.moved  test2
user:~/temp/svnrepotest/wc1/mymodule$ cat test1/def 
abc
456
user:~/temp/svnrepotest/wc1/mymodule$ cat test1.moved/def 
123
abc
user:~/temp/svnrepotest/wc1/mymodule$ cat test2/xyz 
abc
123
ghi


Mehr Informationen über die Mailingliste linux-l