Issue #158 new

clone failure on deletion and recreation of trunk

Jens Malte Gottfried
created an issue

//hgsubversion// fails to clone svn projects in standart layout correctly if their trunk folder was deleted/moved and recreated with empty content.

To demonstrate this, I create a simple test repository which is attached.

Steps to reproduce: {{{ $ svnadmin create test.svn $ bzcat test.svndump.bz2 | svnadmin load test.svn $ hg clone svn+ssh://localhost/<path to home>/test.svn/project1 test-hg using standard layout [r1] jmg: initial import A project1/trunk/file1 ... file1 committed to "default" as e62f4e97712c [r2] jmg: moved project1 trunk to projec2 D project1/trunk/file1 D project1/trunk D trunk/.hgsvnexternals Marked branch default as closed. [r3] jmg: added another file A project1/trunk/file2 file2 committed to "default" as 04cfe20e19c0 pulled 2 revisions ... getting file1 getting file2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg svn verify verifying 04cfe20e19c0 against r3 missing files: file1 }}}

What happened:

"file1" has been created in project1/trunk, then project1/trunk has been deleted, and a plain project1/trunk was created afterwards. In this new trunk directory, a file "file2" has been created. On cloning project1, branch default is marked as closed on deletion of the trunk subdirectory, but it's content does remain. When trunk is recreated later, file1 is still visible in trunk which should not occur.

Comments (2)

  1. Jens Malte Gottfried reporter

    I have added a bash-script to reproduce the issue (which does not depend on the svndump appended earlier).

    Used current tip of hgsubversion: eb16630bceb1 (maps: fix a % formatting bug)

    jmg@pickwick ~/test $ bash -x reproduce-bug-158.sh
    + REPO=/home/jmg/test/testrepo               
    + SVND=/home/jmg/test/test-svn               
    + SHGD=/home/jmg/test/test-hg                
    + LC_ALL=C                                   
    + echo                                       
    
    + for i in '"$REPO"' '"$SVND"' '"$SHGD"'
    + test -d /home/jmg/test/testrepo       
    + rm -rf /home/jmg/test/testrepo        
    + for i in '"$REPO"' '"$SVND"' '"$SHGD"'
    + test -d /home/jmg/test/test-svn       
    + rm -rf /home/jmg/test/test-svn        
    + for i in '"$REPO"' '"$SVND"' '"$SHGD"'
    + test -d /home/jmg/test/test-hg        
    + rm -rf /home/jmg/test/test-hg         
    + echo                                  
    
    + svnadmin create /home/jmg/test/testrepo
    + svn checkout file:///home/jmg/test/testrepo /home/jmg/test/test-svn
    Checked out revision 0.                                              
    + svn mkdir /home/jmg/test/test-svn/trunk                            
    A         /home/jmg/test/test-svn/trunk                              
    + touch /home/jmg/test/test-svn/trunk/file1                          
    + svn add /home/jmg/test/test-svn/trunk/file1                        
    A         /home/jmg/test/test-svn/trunk/file1                        
    + svn ci -m 'created trunk and added file1' /home/jmg/test/test-svn  
    Adding         test-svn/trunk                                        
    Adding         test-svn/trunk/file1                                  
    Transmitting file data .                                             
    Committed revision 1.                                                
    + svn rm /home/jmg/test/test-svn/trunk                               
    D         /home/jmg/test/test-svn/trunk/file1                        
    D         /home/jmg/test/test-svn/trunk                              
    + svn ci -m 'removed trunk' /home/jmg/test/test-svn                  
    Deleting       test-svn/trunk                                        
    
    Committed revision 2.
    + svn mkdir /home/jmg/test/test-svn/trunk
    A         /home/jmg/test/test-svn/trunk  
    + touch /home/jmg/test/test-svn/trunk/file2
    + svn add /home/jmg/test/test-svn/trunk/file2
    A         /home/jmg/test/test-svn/trunk/file2
    + svn ci -m 'created new trunk and added file2' /home/jmg/test/test-svn
    Adding         test-svn/trunk                                          
    Adding         test-svn/trunk/file2                                    
    Transmitting file data .                                               
    Committed revision 3.                                                  
    + echo                                                                 
    
    + hg clone svn+ssh://localhost//home/jmg/test/testrepo /home/jmg/test/test-hg
    using standard layout                                                        
    [r1] jmg: created trunk and added file1                                      
    A trunk/file1                                                                
    substituting author "jmg" for default "jmg@65dc2926-8998-48bd-aaa2-e762a0ac7649"
    file1                                                                           
     committed to "default" as 8e3c85409d86                                         
    [r2] jmg: removed trunk                                                         
    D trunk/file1                                                                   
    D trunk                                                                         
    D trunk/.hgsvnexternals                                                         
    Marked branch default as closed.
    [r3] jmg: created new trunk and added file2
    A trunk/file2
    file2
     committed to "default" as 1bf73ca4c3a6
    pulled 2 revisions
    updating to branch default
    resolving manifests
    getting file1
    getting file2
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    + echo
    
    + ls -lah /home/jmg/test/test-svn/trunk
    total 0
    drwxr-xr-x 3 jmg jmg  96 Mar 31 23:49 .
    drwxr-xr-x 4 jmg jmg  96 Mar 31 23:49 ..
    drwxr-xr-x 6 jmg jmg 184 Mar 31 23:49 .svn
    -rw-r--r-- 1 jmg jmg   0 Mar 31 23:49 file2
    + ls -lah /home/jmg/test/test-hg
    total 0
    drwxr-xr-x 3 jmg jmg 120 Mar 31 23:49 .
    drwxr-xr-x 6 jmg jmg 240 Mar 31 23:49 ..
    drwxr-xr-x 4 jmg jmg 360 Mar 31 23:49 .hg
    -rw-r--r-- 1 jmg jmg   0 Mar 31 23:49 file1
    -rw-r--r-- 1 jmg jmg   0 Mar 31 23:49 file2
    

    Again, as you can see, the content of the checked out svn-repository and of the hg working copy differ as the directory content is not erased on trunk deletion.

  2. Log in to comment