tests/test-removeemptydirs.t
changeset 38662 ad2aa4e85047
parent 38493 da2a7d8354b2
child 39462 e5449ff273d6
equal deleted inserted replaced
38661:8ac0c9cd4c48 38662:ad2aa4e85047
   147 This is essentially the exact test from issue5826, just cleaned up a little:
   147 This is essentially the exact test from issue5826, just cleaned up a little:
   148 
   148 
   149   $ hg init issue5826_withrm
   149   $ hg init issue5826_withrm
   150   $ cd issue5826_withrm
   150   $ cd issue5826_withrm
   151 
   151 
   152   $ cat >> $HGRCPATH <<EOF
   152 Let's only turn this on for this repo so that we don't contaminate later tests.
       
   153   $ cat >> .hg/hgrc <<EOF
   153   > [extensions]
   154   > [extensions]
   154   > histedit =
   155   > histedit =
   155   > EOF
   156   > EOF
   156 Commit three revisions that each create a directory:
   157 Commit three revisions that each create a directory:
   157 
   158 
   197 
   198 
   198 Now test that again with experimental.removeemptydirs=false:
   199 Now test that again with experimental.removeemptydirs=false:
   199   $ hg init issue5826_norm
   200   $ hg init issue5826_norm
   200   $ cd issue5826_norm
   201   $ cd issue5826_norm
   201 
   202 
   202   $ cat >> $HGRCPATH <<EOF
   203 Let's only turn this on for this repo so that we don't contaminate later tests.
       
   204   $ cat >> .hg/hgrc <<EOF
   203   > [extensions]
   205   > [extensions]
   204   > histedit =
   206   > histedit =
   205   > [experimental]
   207   > [experimental]
   206   > removeemptydirs = false
   208   > removeemptydirs = false
   207   > EOF
   209   > EOF
   238   $ hg log -T '{rev}:{node|short} {desc}\n'
   240   $ hg log -T '{rev}:{node|short} {desc}\n'
   239   1:b9eddaa97cbc add foo
   241   1:b9eddaa97cbc add foo
   240   ***
   242   ***
   241   add baz
   243   add baz
   242   0:d17db4b0303a add bar
   244   0:d17db4b0303a add bar
       
   245 
       
   246   $ cd $TESTTMP
       
   247 
       
   248 Testing `hg split` being run from inside of a directory that was created in the
       
   249 commit being split:
       
   250 
       
   251   $ hg init hgsplit
       
   252   $ cd hgsplit
       
   253   $ cat >> .hg/hgrc << EOF
       
   254   > [ui]
       
   255   > interactive = 1
       
   256   > [extensions]
       
   257   > split =
       
   258   > EOF
       
   259   $ echo anchor > anchor.txt
       
   260   $ hg ci -qAm anchor
       
   261 
       
   262 Create a changeset with '/otherfile_in_root' and 'somedir/foo', then try to
       
   263 split it.
       
   264   $ echo otherfile > otherfile_in_root
       
   265   $ mkdir somedir
       
   266   $ cd somedir
       
   267   $ echo hi > foo
       
   268   $ hg ci -qAm split_me
       
   269 (Note: need to make this file not in this directory, or else the bug doesn't
       
   270 reproduce; we're using a separate file due to concerns of portability on
       
   271 `echo -e`)
       
   272   $ cat > ../split_commands << EOF
       
   273   > n
       
   274   > y
       
   275   > y
       
   276   > a
       
   277   > EOF
       
   278   $ cat ../split_commands | hg split
       
   279   current directory was removed
       
   280   (consider changing to repo root: $TESTTMP/hgsplit)
       
   281   diff --git a/otherfile_in_root b/otherfile_in_root
       
   282   new file mode 100644
       
   283   examine changes to 'otherfile_in_root'? [Ynesfdaq?] n
       
   284   
       
   285   diff --git a/somedir/foo b/somedir/foo
       
   286   new file mode 100644
       
   287   examine changes to 'somedir/foo'? [Ynesfdaq?] y
       
   288   
       
   289   @@ -0,0 +1,1 @@
       
   290   +hi
       
   291   record change 2/2 to 'somedir/foo'? [Ynesfdaq?] y
       
   292   
       
   293   abort: $ENOENT$
       
   294   [255]
       
   295 
       
   296 Let's try that again without the rmdir
       
   297   $ cd $TESTTMP/hgsplit/somedir
       
   298 Show that the previous split didn't do anything
       
   299   $ hg log -T '{rev}:{node|short} {desc}\n'
       
   300   1:e26b22a4f0b7 split_me
       
   301   0:7e53273730c0 anchor
       
   302   $ hg status
       
   303   ? split_commands
       
   304 Try again
       
   305   $ cat ../split_commands | hg $NO_RM split
       
   306   diff --git a/otherfile_in_root b/otherfile_in_root
       
   307   new file mode 100644
       
   308   examine changes to 'otherfile_in_root'? [Ynesfdaq?] n
       
   309   
       
   310   diff --git a/somedir/foo b/somedir/foo
       
   311   new file mode 100644
       
   312   examine changes to 'somedir/foo'? [Ynesfdaq?] y
       
   313   
       
   314   @@ -0,0 +1,1 @@
       
   315   +hi
       
   316   record change 2/2 to 'somedir/foo'? [Ynesfdaq?] y
       
   317   
       
   318   created new head
       
   319   diff --git a/otherfile_in_root b/otherfile_in_root
       
   320   new file mode 100644
       
   321   examine changes to 'otherfile_in_root'? [Ynesfdaq?] a
       
   322   
       
   323   saved backup bundle to $TESTTMP/hgsplit/.hg/strip-backup/*-split.hg (glob)
       
   324 Show that this split did something
       
   325   $ hg log -T '{rev}:{node|short} {desc}\n'
       
   326   2:a440f24fca4f split_me
       
   327   1:c994f20276ab split_me
       
   328   0:7e53273730c0 anchor
       
   329   $ hg status
       
   330   ? split_commands