tests/test-fix-topology.t
changeset 44574 5205b46bd887
parent 44560 40f4a75938ba
child 45713 04de8a1ec08f
equal deleted inserted replaced
44573:9f5e94bbc606 44574:5205b46bd887
    19 relationships. We indicate fixed file content by uppercasing it.
    19 relationships. We indicate fixed file content by uppercasing it.
    20 
    20 
    21   $ cat >> $HGRCPATH <<EOF
    21   $ cat >> $HGRCPATH <<EOF
    22   > [extensions]
    22   > [extensions]
    23   > fix =
    23   > fix =
       
    24   > strip =
    24   > [fix]
    25   > [fix]
    25   > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
    26   > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
    26   > uppercase-whole-file:pattern=set:**
    27   > uppercase-whole-file:pattern=set:**
    27   > EOF
    28   > EOF
    28 
    29 
   259   KKKK
   260   KKKK
   260 
   261 
   261 Change A was never a baserev because none of its children were to be fixed.
   262 Change A was never a baserev because none of its children were to be fixed.
   262 
   263 
   263   $ cd ..
   264   $ cd ..
       
   265 
       
   266 
       
   267 Test the --source option. We only do this with obsstore on to avoid duplicating
       
   268 test code. We rely on the other tests to prove that obsolescence is not an
       
   269 important factor here.
       
   270 
       
   271 #if obsstore-on
       
   272   $ hg init source-arg
       
   273   $ cd source-arg
       
   274   $ printf "aaaa\n" > a
       
   275   $ hg commit -Am "change A"
       
   276   adding a
       
   277   $ printf "bbbb\n" > b
       
   278   $ hg commit -Am "change B"
       
   279   adding b
       
   280   $ printf "cccc\n" > c
       
   281   $ hg commit -Am "change C"
       
   282   adding c
       
   283   $ hg checkout 0
       
   284   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   285   $ printf "dddd\n" > d
       
   286   $ hg commit -Am "change D"
       
   287   adding d
       
   288   created new head
       
   289   $ hg log --graph --template '{rev} {desc}\n'
       
   290   @  3 change D
       
   291   |
       
   292   | o  2 change C
       
   293   | |
       
   294   | o  1 change B
       
   295   |/
       
   296   o  0 change A
       
   297   
       
   298 
       
   299 Test passing 'wdir()' to --source
       
   300   $ printf "xxxx\n" > x
       
   301   $ hg add x
       
   302   $ hg fix -s 'wdir()'
       
   303   $ cat *
       
   304   aaaa
       
   305   dddd
       
   306   XXXX
       
   307 
       
   308 Test passing '.' to --source
       
   309   $ printf "xxxx\n" > x
       
   310   $ hg fix -s .
       
   311   $ hg log --graph --template '{rev} {desc}\n'
       
   312   @  4 change D
       
   313   |
       
   314   | o  2 change C
       
   315   | |
       
   316   | o  1 change B
       
   317   |/
       
   318   o  0 change A
       
   319   
       
   320   $ cat *
       
   321   aaaa
       
   322   DDDD
       
   323   XXXX
       
   324   $ hg strip -qf 4
       
   325   $ hg co -q 3
       
   326 
       
   327 Test passing other branch to --source
       
   328   $ printf "xxxx\n" > x
       
   329   $ hg add x
       
   330   $ hg fix -s 2
       
   331   $ hg log --graph --template '{rev} {desc}\n'
       
   332   o  4 change C
       
   333   |
       
   334   | @  3 change D
       
   335   | |
       
   336   o |  1 change B
       
   337   |/
       
   338   o  0 change A
       
   339   
       
   340   $ hg cat -r 4 b c
       
   341   bbbb
       
   342   CCCC
       
   343   $ cat *
       
   344   aaaa
       
   345   dddd
       
   346   xxxx
       
   347   $ hg strip -qf 4
       
   348 
       
   349 Test passing multiple revisions to --source
       
   350   $ hg fix -s '2 + .'
       
   351   $ hg log --graph --template '{rev} {desc}\n'
       
   352   @  5 change D
       
   353   |
       
   354   | o  4 change C
       
   355   | |
       
   356   | o  1 change B
       
   357   |/
       
   358   o  0 change A
       
   359   
       
   360   $ hg cat -r 4 b c
       
   361   bbbb
       
   362   CCCC
       
   363   $ cat *
       
   364   aaaa
       
   365   DDDD
       
   366   XXXX
       
   367 
       
   368   $ cd ..
       
   369 #endif
   264 
   370 
   265 The --all flag should fix anything that wouldn't cause a problem if you fixed
   371 The --all flag should fix anything that wouldn't cause a problem if you fixed
   266 it, including the working copy. Obsolete revisions are not fixed because that
   372 it, including the working copy. Obsolete revisions are not fixed because that
   267 could cause divergence. Public revisions would cause an abort because they are
   373 could cause divergence. Public revisions would cause an abort because they are
   268 immutable. We can fix orphans because their successors are still just orphans
   374 immutable. We can fix orphans because their successors are still just orphans