tests/test-fix-topology.t
changeset 37595 e2506748b47f
parent 37560 41ba336d9f1e
child 38426 c1f4364f9336
equal deleted inserted replaced
37594:b1f62cd39b5c 37595:e2506748b47f
   264 
   264 
   265 Change A was never a baserev because none of its children were to be fixed.
   265 Change A was never a baserev because none of its children were to be fixed.
   266 
   266 
   267   $ cd ..
   267   $ cd ..
   268 
   268 
       
   269 The --all flag should fix anything that wouldn't cause a problem if you fixed
       
   270 it, including the working copy. Obsolete revisions are not fixed because that
       
   271 could cause divergence. Public revisions would cause an abort because they are
       
   272 immutable. We can fix orphans because their successors are still just orphans
       
   273 of the original obsolete parent. When obsolesence is off, we're just fixing and
       
   274 replacing anything that isn't public.
       
   275 
       
   276   $ hg init fixall
       
   277   $ cd fixall
       
   278 
       
   279 #if obsstore-on
       
   280   $ printf "one\n" > foo.whole
       
   281   $ hg commit -Aqm "first"
       
   282   $ hg phase --public
       
   283   $ hg tag --local root
       
   284   $ printf "two\n" > foo.whole
       
   285   $ hg commit -m "second"
       
   286   $ printf "three\n" > foo.whole
       
   287   $ hg commit -m "third" --secret
       
   288   $ hg tag --local secret
       
   289   $ hg checkout root
       
   290   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   291   $ printf "four\n" > foo.whole
       
   292   $ hg commit -m "fourth"
       
   293   created new head
       
   294   $ printf "five\n" > foo.whole
       
   295   $ hg commit -m "fifth"
       
   296   $ hg tag --local replaced
       
   297   $ printf "six\n" > foo.whole
       
   298   $ hg commit -m "sixth"
       
   299   $ hg checkout replaced
       
   300   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   301   $ printf "seven\n" > foo.whole
       
   302   $ hg commit --amend
       
   303   1 new orphan changesets
       
   304   $ hg checkout secret
       
   305   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   306   $ printf "uncommitted\n" > foo.whole
       
   307 
       
   308   $ hg log --graph --template '{rev} {desc} {phase}\n'
       
   309   o  6 fifth draft
       
   310   |
       
   311   | *  5 sixth draft
       
   312   | |
       
   313   | x  4 fifth draft
       
   314   |/
       
   315   o  3 fourth draft
       
   316   |
       
   317   | @  2 third secret
       
   318   | |
       
   319   | o  1 second draft
       
   320   |/
       
   321   o  0 first public
       
   322   
       
   323 
       
   324   $ hg fix --all
       
   325   1 new orphan changesets
       
   326 
       
   327   $ hg log --graph --template '{rev} {desc}\n' -r 'sort(all(), topo)' --hidden
       
   328   o  11 fifth
       
   329   |
       
   330   o  9 fourth
       
   331   |
       
   332   | @  8 third
       
   333   | |
       
   334   | o  7 second
       
   335   |/
       
   336   | *  10 sixth
       
   337   | |
       
   338   | | x  5 sixth
       
   339   | |/
       
   340   | x  4 fifth
       
   341   | |
       
   342   | | x  6 fifth
       
   343   | |/
       
   344   | x  3 fourth
       
   345   |/
       
   346   | x  2 third
       
   347   | |
       
   348   | x  1 second
       
   349   |/
       
   350   o  0 first
       
   351   
       
   352 
       
   353   $ hg cat -r 7 foo.whole
       
   354   TWO
       
   355   $ hg cat -r 8 foo.whole
       
   356   THREE
       
   357   $ hg cat -r 9 foo.whole
       
   358   FOUR
       
   359   $ hg cat -r 10 foo.whole
       
   360   SIX
       
   361   $ hg cat -r 11 foo.whole
       
   362   SEVEN
       
   363   $ cat foo.whole
       
   364   UNCOMMITTED
       
   365 #else
       
   366   $ printf "one\n" > foo.whole
       
   367   $ hg commit -Aqm "first"
       
   368   $ hg phase --public
       
   369   $ hg tag --local root
       
   370   $ printf "two\n" > foo.whole
       
   371   $ hg commit -m "second"
       
   372   $ printf "three\n" > foo.whole
       
   373   $ hg commit -m "third" --secret
       
   374   $ hg tag --local secret
       
   375   $ hg checkout root
       
   376   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   377   $ printf "four\n" > foo.whole
       
   378   $ hg commit -m "fourth"
       
   379   created new head
       
   380   $ printf "uncommitted\n" > foo.whole
       
   381 
       
   382   $ hg log --graph --template '{rev} {desc} {phase}\n'
       
   383   @  3 fourth draft
       
   384   |
       
   385   | o  2 third secret
       
   386   | |
       
   387   | o  1 second draft
       
   388   |/
       
   389   o  0 first public
       
   390   
       
   391 
       
   392   $ hg fix --all
       
   393   saved backup bundle to * (glob)
       
   394 
       
   395   $ hg log --graph --template '{rev} {desc} {phase}\n'
       
   396   @  3 fourth draft
       
   397   |
       
   398   | o  2 third secret
       
   399   | |
       
   400   | o  1 second draft
       
   401   |/
       
   402   o  0 first public
       
   403   
       
   404   $ hg cat -r 0 foo.whole
       
   405   one
       
   406   $ hg cat -r 1 foo.whole
       
   407   TWO
       
   408   $ hg cat -r 2 foo.whole
       
   409   THREE
       
   410   $ hg cat -r 3 foo.whole
       
   411   FOUR
       
   412   $ cat foo.whole
       
   413   UNCOMMITTED
       
   414 #endif
       
   415 
       
   416   $ cd ..
       
   417