tests/test-histedit-obsolete.t
branchstable
changeset 27977 b698abf971e7
parent 27674 78d86664e3a2
child 28004 34165875fa5d
equal deleted inserted replaced
27976:8f4d3eeb5198 27977:b698abf971e7
   150 
   150 
   151   $ hg rebase  -r 'unstable()' -d .
   151   $ hg rebase  -r 'unstable()' -d .
   152   rebasing 11:c13eb81022ca "f"
   152   rebasing 11:c13eb81022ca "f"
   153   $ hg up tip -q
   153   $ hg up tip -q
   154 
   154 
   155 check that extra has accumulated from histedit and rebase
       
   156 
       
   157   $ hg log -T '{extras % "{key}={value}\n"}\n' -r tip
       
   158   branch=default
       
   159   histedit_source=cacdfd884a9321ec4e1de275ef3949fa953a1f83
       
   160   rebase_source=c13eb81022caa686a369223fe7f926bc4f7db576
       
   161   
       
   162 
       
   163 Test dropping of changeset on the top of the stack
   155 Test dropping of changeset on the top of the stack
   164 -------------------------------------------------------
   156 -------------------------------------------------------
   165 
   157 
   166 Nothing is rewritten below, the working directory parent must be change for the
   158 Nothing is rewritten below, the working directory parent must be change for the
   167 dropped changeset to be hidden.
   159 dropped changeset to be hidden.
   171   updating to branch default
   163   updating to branch default
   172   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   164   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   173   $ cd droplast
   165   $ cd droplast
   174   $ hg histedit -r '40db8afa467b' --commands - << EOF
   166   $ hg histedit -r '40db8afa467b' --commands - << EOF
   175   > pick 40db8afa467b 10 c
   167   > pick 40db8afa467b 10 c
   176   > drop 947ece25170f 11 f
   168   > drop b449568bf7fc 11 f
   177   > EOF
   169   > EOF
   178   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   170   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   179   $ hg log -G
   171   $ hg log -G
   180   @  12:40db8afa467b c
   172   @  12:40db8afa467b c
   181   |
   173   |
   219   > EOF
   211   > EOF
   220 
   212 
   221   $ hg ph -pv '.^'
   213   $ hg ph -pv '.^'
   222   phase changed for 2 changesets
   214   phase changed for 2 changesets
   223   $ hg log -G
   215   $ hg log -G
   224   @  13:947ece25170f (draft) f
   216   @  13:b449568bf7fc (draft) f
   225   |
   217   |
   226   o  12:40db8afa467b (public) c
   218   o  12:40db8afa467b (public) c
   227   |
   219   |
   228   o  0:cb9a9f314b8b (public) a
   220   o  0:cb9a9f314b8b (public) a
   229   
   221   
   241   >     hg add $x
   233   >     hg add $x
   242   >     hg ci -m $x
   234   >     hg ci -m $x
   243   > done
   235   > done
   244   $ hg phase --force --secret .~2
   236   $ hg phase --force --secret .~2
   245   $ hg log -G
   237   $ hg log -G
   246   @  18:14bda137d5b3 (secret) k
   238   @  18:ee118ab9fa44 (secret) k
   247   |
   239   |
   248   o  17:c62e7241a4f2 (secret) j
   240   o  17:3a6c53ee7f3d (secret) j
   249   |
   241   |
   250   o  16:9cd3934e05af (secret) i
   242   o  16:b605fb7503f2 (secret) i
   251   |
   243   |
   252   o  15:ee4a24fc4dfa (draft) h
   244   o  15:7395e1ff83bd (draft) h
   253   |
   245   |
   254   o  14:d22905de3528 (draft) g
   246   o  14:6b70183d2492 (draft) g
   255   |
   247   |
   256   o  13:947ece25170f (draft) f
   248   o  13:b449568bf7fc (draft) f
   257   |
   249   |
   258   o  12:40db8afa467b (public) c
   250   o  12:40db8afa467b (public) c
   259   |
   251   |
   260   o  0:cb9a9f314b8b (public) a
   252   o  0:cb9a9f314b8b (public) a
   261   
   253   
   269 
   261 
   270 New-commit as draft (default)
   262 New-commit as draft (default)
   271 
   263 
   272   $ cp -r base simple-draft
   264   $ cp -r base simple-draft
   273   $ cd simple-draft
   265   $ cd simple-draft
   274   $ hg histedit -r '947ece25170f' --commands - << EOF
   266   $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   275   > edit 947ece25170f 11 f
   267   > edit b449568bf7fc 11 f
   276   > pick d22905de3528 12 g
   268   > pick 6b70183d2492 12 g
   277   > pick ee4a24fc4dfa 13 h
   269   > pick 7395e1ff83bd 13 h
   278   > pick 9cd3934e05af 14 i
   270   > pick b605fb7503f2 14 i
   279   > pick c62e7241a4f2 15 j
   271   > pick 3a6c53ee7f3d 15 j
   280   > pick 14bda137d5b3 16 k
   272   > pick ee118ab9fa44 16 k
   281   > EOF
   273   > EOF
   282   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   274   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   283   adding f
   275   adding f
   284   Editing (947ece25170f), you may commit or record as needed now.
   276   Editing (b449568bf7fc), you may commit or record as needed now.
   285   (hg histedit --continue to resume)
   277   (hg histedit --continue to resume)
   286   [1]
   278   [1]
   287   $ echo f >> f
   279   $ echo f >> f
   288   $ hg histedit --continue
   280   $ hg histedit --continue
   289   $ hg log -G
   281   $ hg log -G
   290   @  24:12925f763c90 (secret) k
   282   @  24:12e89af74238 (secret) k
   291   |
   283   |
   292   o  23:4545a6e77442 (secret) j
   284   o  23:636a8687b22e (secret) j
   293   |
   285   |
   294   o  22:d947a0798e76 (secret) i
   286   o  22:ccaf0a38653f (secret) i
   295   |
   287   |
   296   o  21:28fb35ae4ebb (draft) h
   288   o  21:11a89d1c2613 (draft) h
   297   |
   289   |
   298   o  20:10b22a5a9645 (draft) g
   290   o  20:c1dec7ca82ea (draft) g
   299   |
   291   |
   300   o  19:c5a1db4a69f5 (draft) f
   292   o  19:087281e68428 (draft) f
   301   |
   293   |
   302   o  12:40db8afa467b (public) c
   294   o  12:40db8afa467b (public) c
   303   |
   295   |
   304   o  0:cb9a9f314b8b (public) a
   296   o  0:cb9a9f314b8b (public) a
   305   
   297   
   312   $ cd simple-secret
   304   $ cd simple-secret
   313   $ cat >> .hg/hgrc << EOF
   305   $ cat >> .hg/hgrc << EOF
   314   > [phases]
   306   > [phases]
   315   > new-commit=secret
   307   > new-commit=secret
   316   > EOF
   308   > EOF
   317   $ hg histedit -r '947ece25170f' --commands - << EOF
   309   $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   318   > edit 947ece25170f 11 f
   310   > edit b449568bf7fc 11 f
   319   > pick d22905de3528 12 g
   311   > pick 6b70183d2492 12 g
   320   > pick ee4a24fc4dfa 13 h
   312   > pick 7395e1ff83bd 13 h
   321   > pick 9cd3934e05af 14 i
   313   > pick b605fb7503f2 14 i
   322   > pick c62e7241a4f2 15 j
   314   > pick 3a6c53ee7f3d 15 j
   323   > pick 14bda137d5b3 16 k
   315   > pick ee118ab9fa44 16 k
   324   > EOF
   316   > EOF
   325   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   317   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   326   adding f
   318   adding f
   327   Editing (947ece25170f), you may commit or record as needed now.
   319   Editing (b449568bf7fc), you may commit or record as needed now.
   328   (hg histedit --continue to resume)
   320   (hg histedit --continue to resume)
   329   [1]
   321   [1]
   330   $ echo f >> f
   322   $ echo f >> f
   331   $ hg histedit --continue
   323   $ hg histedit --continue
   332   $ hg log -G
   324   $ hg log -G
   333   @  24:12925f763c90 (secret) k
   325   @  24:12e89af74238 (secret) k
   334   |
   326   |
   335   o  23:4545a6e77442 (secret) j
   327   o  23:636a8687b22e (secret) j
   336   |
   328   |
   337   o  22:d947a0798e76 (secret) i
   329   o  22:ccaf0a38653f (secret) i
   338   |
   330   |
   339   o  21:28fb35ae4ebb (draft) h
   331   o  21:11a89d1c2613 (draft) h
   340   |
   332   |
   341   o  20:10b22a5a9645 (draft) g
   333   o  20:c1dec7ca82ea (draft) g
   342   |
   334   |
   343   o  19:c5a1db4a69f5 (draft) f
   335   o  19:087281e68428 (draft) f
   344   |
   336   |
   345   o  12:40db8afa467b (public) c
   337   o  12:40db8afa467b (public) c
   346   |
   338   |
   347   o  0:cb9a9f314b8b (public) a
   339   o  0:cb9a9f314b8b (public) a
   348   
   340   
   355 If a secret changeset is put before a draft one, all descendant should be secret.
   347 If a secret changeset is put before a draft one, all descendant should be secret.
   356 It seems more important to present the secret phase.
   348 It seems more important to present the secret phase.
   357 
   349 
   358   $ cp -r base reorder
   350   $ cp -r base reorder
   359   $ cd reorder
   351   $ cd reorder
   360   $ hg histedit -r '947ece25170f' --commands - << EOF
   352   $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   361   > pick 947ece25170f 11 f
   353   > pick b449568bf7fc 11 f
   362   > pick c62e7241a4f2 15 j
   354   > pick 3a6c53ee7f3d 15 j
   363   > pick d22905de3528 12 g
   355   > pick 6b70183d2492 12 g
   364   > pick 9cd3934e05af 14 i
   356   > pick b605fb7503f2 14 i
   365   > pick ee4a24fc4dfa 13 h
   357   > pick 7395e1ff83bd 13 h
   366   > pick 14bda137d5b3 16 k
   358   > pick ee118ab9fa44 16 k
   367   > EOF
   359   > EOF
   368   0 files updated, 0 files merged, 5 files removed, 0 files unresolved
   360   0 files updated, 0 files merged, 5 files removed, 0 files unresolved
   369   $ hg log -G
   361   $ hg log -G
   370   @  23:9e712162b2c1 (secret) k
   362   @  23:558246857888 (secret) k
   371   |
   363   |
   372   o  22:490861543602 (secret) h
   364   o  22:28bd44768535 (secret) h
   373   |
   365   |
   374   o  21:86aeda50b70d (secret) i
   366   o  21:d5395202aeb9 (secret) i
   375   |
   367   |
   376   o  20:b2fa360bc090 (secret) g
   368   o  20:21edda8e341b (secret) g
   377   |
   369   |
   378   o  19:e10fb4e3eb8e (secret) j
   370   o  19:5ab64f3a4832 (secret) j
   379   |
   371   |
   380   o  13:947ece25170f (draft) f
   372   o  13:b449568bf7fc (draft) f
   381   |
   373   |
   382   o  12:40db8afa467b (public) c
   374   o  12:40db8afa467b (public) c
   383   |
   375   |
   384   o  0:cb9a9f314b8b (public) a
   376   o  0:cb9a9f314b8b (public) a
   385   
   377   
   397   $ cd folding
   389   $ cd folding
   398   $ cat >> .hg/hgrc << EOF
   390   $ cat >> .hg/hgrc << EOF
   399   > [phases]
   391   > [phases]
   400   > new-commit=secret
   392   > new-commit=secret
   401   > EOF
   393   > EOF
   402   $ hg histedit -r '947ece25170f' --commands - << EOF
   394   $ hg histedit -r 'b449568bf7fc' --commands - << EOF
   403   > pick ee4a24fc4dfa 13 h
   395   > pick 7395e1ff83bd 13 h
   404   > fold 947ece25170f 11 f
   396   > fold b449568bf7fc 11 f
   405   > pick d22905de3528 12 g
   397   > pick 6b70183d2492 12 g
   406   > fold c62e7241a4f2 15 j
   398   > fold 3a6c53ee7f3d 15 j
   407   > pick 9cd3934e05af 14 i
   399   > pick b605fb7503f2 14 i
   408   > fold 14bda137d5b3 16 k
   400   > fold ee118ab9fa44 16 k
   409   > EOF
   401   > EOF
   410   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   402   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   411   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   403   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   412   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   404   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   413   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   405   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   414   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   406   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   415   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   407   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   416   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   408   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   417   $ hg log -G
   409   $ hg log -G
   418   @  27:769e8ee8708e (secret) i
   410   @  27:f9daec13fb98 (secret) i
   419   |
   411   |
   420   o  24:3de6dbab1b62 (secret) g
   412   o  24:49807617f46a (secret) g
   421   |
   413   |
   422   o  21:1d51647632b2 (draft) h
   414   o  21:050280826e04 (draft) h
   423   |
   415   |
   424   o  12:40db8afa467b (public) c
   416   o  12:40db8afa467b (public) c
   425   |
   417   |
   426   o  0:cb9a9f314b8b (public) a
   418   o  0:cb9a9f314b8b (public) a
   427   
   419   
   428   $ hg co 3de6dbab1b62
   420   $ hg co 49807617f46a
   429   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   421   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   430   $ echo wat >> wat
   422   $ echo wat >> wat
   431   $ hg add wat
   423   $ hg add wat
   432   $ hg ci -m 'add wat'
   424   $ hg ci -m 'add wat'
   433   created new head
   425   created new head
   434   $ hg merge 769e8ee8708e
   426   $ hg merge f9daec13fb98
   435   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   427   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   436   (branch merge, don't forget to commit)
   428   (branch merge, don't forget to commit)
   437   $ hg ci -m 'merge'
   429   $ hg ci -m 'merge'
   438   $ echo not wat > wat
   430   $ echo not wat > wat
   439   $ hg ci -m 'modify wat'
   431   $ hg ci -m 'modify wat'
   440   $ hg histedit 1d51647632b2
   432   $ hg histedit 050280826e04
   441   abort: cannot edit history that contains merges
   433   abort: cannot edit history that contains merges
   442   [255]
   434   [255]
   443   $ cd ..
   435   $ cd ..