ID: |
6008
|
Fixed in: |
|
Issue Date: |
2010-10-02 12:14 AEST
|
Owner: | CVS Support
|
Last Modified: | 2014-03-15 03:53 AEST | Reporter: | Glen Starrett
|
Current Est. | 0.0 hours
| % Complete: | 0.0
|
Status: | NEW /
|
Severity: | normal
|
Affected: | 2.5.03
|
Description: | Rename twice can cause file to disappear
|
Actions:
|
2010-10-02 12:14 AEST by Glen Starrett - cvs rename a file then cvs rename it back again, then commit, and the file
suddenly become "no longer in repo" and "nothing known about".
C:\My_Documents\Test\stanley-test2\testcvs>cvs add -kbx "Another test.doc"
cvsnt server: scheduling file `Another test.doc' for addition
cvsnt server: use 'cvsnt commit' to add this file permanently
C:\My_Documents\Test\stanley-test2\testcvs>cvs ci -m "Added another doc"
cvs commit: Examining .
cvs commit: Examining sub
cvs commit: Examining sub2
RCS file: /test2/testcvs/Another test.doc,v
done
Checking in Another test.doc;
/test2/testcvs/Another test.doc,v <-- Another test.doc
initial revision: 1.1
done
C:\My_Documents\Test\stanley-test2\testcvs>dir
Volume in drive C is No Fate
Volume Serial Number is 3055-6498
Directory of C:\My_Documents\Test\stanley-test2\testcvs
10/01/2010 06:28 PM <DIR> .
10/01/2010 06:28 PM <DIR> ..
10/01/2010 06:27 PM 22,016 Another test.doc
10/01/2010 06:15 PM <DIR> sub
10/01/2010 06:15 PM <DIR> sub2
10/01/2010 05:12 PM 34 test1.txt
10/01/2010 05:12 PM 34 test2.txt
3 File(s) 22,084 bytes
4 Dir(s) 361,424,855,040 bytes free
C:\My_Documents\Test\stanley-test2\testcvs>cvs ren "Another test.doc" "Another t
est1.doc"
cvs rename: Warning: Use rename only as described in the eBook "All About CVS".
C:\My_Documents\Test\stanley-test2\testcvs>cvs ren "Another test1.doc" "Another
test.doc"
cvs rename: Warning: Use rename only as described in the eBook "All About CVS".
C:\My_Documents\Test\stanley-test2\testcvs>dir
Volume in drive C is No Fate
Volume Serial Number is 3055-6498
Directory of C:\My_Documents\Test\stanley-test2\testcvs
10/01/2010 06:28 PM <DIR> .
10/01/2010 06:28 PM <DIR> ..
10/01/2010 06:27 PM 22,016 Another test.doc
10/01/2010 06:15 PM <DIR> sub
10/01/2010 06:15 PM <DIR> sub2
10/01/2010 05:12 PM 34 test1.txt
10/01/2010 05:12 PM 34 test2.txt
3 File(s) 22,084 bytes
4 Dir(s) 361,424,711,680 bytes free
C:\My_Documents\Test\stanley-test2\testcvs>cvs up -dP
cvsnt server: Updating .
cvsnt server: nothing known about test_doc.doc
cvsnt server: Updating sub
cvsnt server: Updating sub2
C:\My_Documents\Test\stanley-test2\testcvs>cvs up -CAdP
cvsnt server: Updating .
cvsnt server: nothing known about test_doc.doc
cvsnt server: Updating sub
cvsnt server: Updating sub2
C:\My_Documents\Test\stanley-test2\testcvs>dir
Volume in drive C is No Fate
Volume Serial Number is 3055-6498
Directory of C:\My_Documents\Test\stanley-test2\testcvs
10/01/2010 06:28 PM <DIR> .
10/01/2010 06:28 PM <DIR> ..
10/01/2010 06:27 PM 22,016 Another test.doc
10/01/2010 06:15 PM <DIR> sub
10/01/2010 06:15 PM <DIR> sub2
10/01/2010 05:12 PM 34 test1.txt
10/01/2010 05:12 PM 34 test2.txt
3 File(s) 22,084 bytes
4 Dir(s) 361,425,534,976 bytes free
C:\My_Documents\Test\stanley-test2\testcvs>cvs add -kx "Another test.doc"
cvsnt server: Another test.doc already exists, with version number 1.1
C:\My_Documents\Test\stanley-test2\testcvs>cvs ci -m "wtf"
cvs commit: Examining .
cvs commit: Examining sub
cvs commit: Examining sub2
cvsnt server: Examining .
cvsnt server: Examining sub
cvsnt server: Examining sub2
/test2/testcvs/.directory_history,v <-- directory update
new revision: 1.4; previous revision: 1.3
done
C:\My_Documents\Test\stanley-test2\testcvs>cvs up -dP
cvsnt server: Updating .
cvsnt server: Another test.doc is no longer in the repository
cvsnt server: nothing known about test_doc.doc
cvsnt server: Updating sub
cvsnt server: Updating sub2
C:\My_Documents\Test\stanley-test2\testcvs>dir
Volume in drive C is No Fate
Volume Serial Number is 3055-6498
Directory of C:\My_Documents\Test\stanley-test2\testcvs
10/01/2010 06:29 PM <DIR> .
10/01/2010 06:29 PM <DIR> ..
10/01/2010 06:15 PM <DIR> sub
10/01/2010 06:15 PM <DIR> sub2
10/01/2010 05:12 PM 34 test1.txt
10/01/2010 05:12 PM 34 test2.txt
2 File(s) 68 bytes
4 Dir(s) 361,425,055,744 bytes free
C:\My_Documents\Test\stanley-test2\testcvs>cvs ver
Client: Concurrent Versions System (CVSNT) 2.5.03 (Scorpio) Build 3804 (client/s
erver)
Server: Concurrent Versions System (CVSNT) 2.5.03 (Scorpio) Build 3804 (client/s
erver)
C:\My_Documents\Test\stanley-test2\testcvs>cvs log "Another test.doc"
cvsnt server: nothing known about Another test.doc |
|
2010-10-02 12:17 AEST by Glen Starrett - Created an attachment (id=1934)
dir_history file
|
|
2010-10-02 12:17 AEST by Glen Starrett - Created an attachment (id=1935)
RCS file for Another text.doc
|
|
2010-10-02 12:40 AEST by Glen Starrett - There should be a way to "undo" the rename operation before committing (e.g. cvs
up -CA). Right now the only way to safely undo an in-progress rename is to
remove the sandbox and checkout again AFAICT.
|
|
2010-10-02 12:42 AEST by Glen Starrett - Removing .Directory_history,v from the repository allows the "invisible" files
to be checked out again. Not sure how this would interact / cause problems with
other files that may be in various states of rename, but could be used to "undo"
a rename operation if this was the first against that module. |
|
2014-03-15 03:53 AEST by Glen Starrett - Renaming multiple times that loop back to a previous name is BROKEN.
I have done some additional experimentation and found that this happens even
when following the proper guidelines (cvs ren a b; cd ..; cvs ci) for each
rename IF the filename is renamed back to the original file name (and possibly
any former name in the chain of renames).
Setup to reproduce:
Have a test sandbox.
echo Hi > a.txt
cvs add a.txt
cvs ci -m "" a.txt
cvs ren a.txt b.txt
cd ..
cvs ci -m "a to b"
NOTE: ignore the entries for "b1", "b2", "c1", and "c2". They were other
renamed files in the same module but aren't part of this repro case.
So how does a test rename look after it has been renamed back? Trying now with
my samp/bar/b.txt renaming back to a.txt.
1.4
log
@*** empty log message ***
@
text
@samp/bar/a.txt
samp/bar/b.txt
samp/bar/a.txt
samp/bar/b1.txt
samp/bar/b2.txt
samp/bar/b2.txt
samp/bar/c1.txt
samp/bar/c2.txt
samp/bar/c2.txt
@
This is starting to more closely resemble the TMQ .directory_history file with
the odd placement of whitespace.
>> AND I get an error when checking out exactly like the one TMQ reported:
C:\Users\Glen Starrett\Documents\test\europa\samp>rd /q/s bar
C:\Users\Glen Starrett\Documents\test\europa\samp>cvs -q up -dP
? ci.txt
? grep
? foo/a.txt
? promo/tst
cvsntsrv server: nothing known about bar/a.txt
U bar/b2.txt
So now I rename it again to b.txt and it comes back with the SAME error, and it
did NOT update .directory_history: The file is just GONE.
I can edit .directory_history back to it's 'correct' state:
1.4
log
@*** empty log message ***
@
text
@samp/bar/a.txt
samp/bar/b.txt
samp/bar/a.txt
samp/bar/b1.txt
samp/bar/b2.txt
samp/bar/b2.txt
samp/bar/c1.txt
samp/bar/c2.txt
samp/bar/c2.txt
Now I can checkout again and it will show up:
C:\Users\Glen Starrett\Documents\test\europa\samp>rd /q/s bar
C:\Users\Glen Starrett\Documents\test\europa\samp>cvs -q up -dP
? ci.txt
? grep
? foo/a.txt
? promo/tst
U bar/b.txt
U bar/b2.txt
U bar/c2.txt
Now I can try the rename again, but it works and updates .directory_history to
1.5 now. Maybe I flubbed the previous? The file is there in bar renamed
properly, but not all is right: .directory_history is still hosed as the
original 1.4 revision looked.
C:\Users\Glen Starrett\Documents\test\europa\samp>dir bar
Volume in drive C is OS
Volume Serial Number is 662A-18BA
Directory of C:\Users\Glen Starrett\Documents\test\europa\samp\bar
03/14/2014 11:36 AM <DIR> .
03/14/2014 11:36 AM <DIR> ..
03/14/2014 10:15 AM 7 a.txt
03/14/2014 10:17 AM 8 b2.txt
03/14/2014 10:17 AM 8 c2.txt
3 File(s) 23 bytes
2 Dir(s) 202,444,816,384 bytes free
C:\Users\Glen Starrett\Documents\test\europa\samp>cd bar
C:\Users\Glen Starrett\Documents\test\europa\samp\bar>cvs up
cvsntsrv server: Updating .
cvsntsrv server: a.txt is no longer in the repository
Uh oh…. No, it's not right at all.
C:\Users\Glen Starrett\Documents\test\europa\samp\bar>cvs up
cvsntsrv server: Updating .
cvsntsrv server: nothing known about a.txt
There's the problem.
I've reset to the original (working) a -> b rename state in .directory_history
by changing it's entry back to:
@samp/bar/a.txt
samp/bar/b.txt
samp/bar/b.txt
OK, so now it's b. I rename to f.txt and now the .directory_history looks like
this:
@samp/bar/a.txt
samp/bar/f.txt
samp/bar/b.txt
samp/bar/b1.txt
samp/bar/b2.txt
samp/bar/b2.txt
samp/bar/c1.txt
samp/bar/c2.txt
samp/bar/c2.txt
samp/bar/f.txt
Now I'll update & see if it's still working or going to fall flat again. So far
so good. Try RD & update parent. Also still good. Now I'll try to rename
f.txt back to a.txt: OK so far, .directory_history updated to 1.7 and is now:
1.7
log
@f to a rename
@
text
@samp/bar/a.txt
samp/bar/b.txt
samp/bar/b1.txt
samp/bar/b2.txt
samp/bar/b2.txt
samp/bar/c1.txt
samp/bar/c2.txt
samp/bar/c2.txt
samp/bar/f.txt
samp/bar/a.txt
@
OK, so the real test: can I update without error? NO
C:\Users\Glen Starrett\Documents\test\europa\samp>cd bar
C:\Users\Glen Starrett\Documents\test\europa\samp\bar>cvs up
cvsntsrv server: Updating .
cvsntsrv server: a.txt is no longer in the repository
C:\Users\Glen Starrett\Documents\test\europa\samp\bar>cvs up
cvsntsrv server: Updating .
cvsntsrv server: nothing known about a.txt
So it seems looping back to a (previous?|original?) name in the rename chain
causes this issue.
|
|