tests/test-graft.t
changeset 23505 bd5dbb8a05c8
parent 23504 e172a1f2b5bb
child 23506 dc82f1a7436d
equal deleted inserted replaced
23504:e172a1f2b5bb 23505:bd5dbb8a05c8
    80 
    80 
    81   $ hg status --rev "2^1" --rev 2
    81   $ hg status --rev "2^1" --rev 2
    82   A b
    82   A b
    83   R a
    83   R a
    84   $ HGEDITOR=cat hg graft 2 -u foo --edit
    84   $ HGEDITOR=cat hg graft 2 -u foo --edit
    85   grafting revision 2
    85   grafting 2:5c095ad7e90f "2"
    86   merging a and b to b
    86   merging a and b to b
    87   2
    87   2
    88   
    88   
    89   
    89   
    90   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
    90   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   131 (this also tests that editor is not invoked if '--edit' is not specified)
   131 (this also tests that editor is not invoked if '--edit' is not specified)
   132 
   132 
   133   $ hg graft 1 5 4 3 'merge()' 2 -n
   133   $ hg graft 1 5 4 3 'merge()' 2 -n
   134   skipping ungraftable merge revision 6
   134   skipping ungraftable merge revision 6
   135   skipping revision 2 (already grafted to 7)
   135   skipping revision 2 (already grafted to 7)
   136   grafting revision 1
   136   grafting 1:5d205f8b35b6 "1"
   137   grafting revision 5
   137   grafting 5:97f8bfe72746 "5"
   138   grafting revision 4
   138   grafting 4:9c233e8e184d "4"
   139   grafting revision 3
   139   grafting 3:4c60f11aa304 "3"
   140 
   140 
   141   $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
   141   $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug
   142   skipping ungraftable merge revision 6
   142   skipping ungraftable merge revision 6
   143   scanning for duplicate grafts
   143   scanning for duplicate grafts
   144   skipping revision 2 (already grafted to 7)
   144   skipping revision 2 (already grafted to 7)
   145   grafting revision 1
   145   grafting 1:5d205f8b35b6 "1"
   146     searching for copies back to rev 1
   146     searching for copies back to rev 1
   147     unmatched files in local:
   147     unmatched files in local:
   148      b
   148      b
   149     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
   149     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
   150      src: 'a' -> dst: 'b' *
   150      src: 'a' -> dst: 'b' *
   158   picked tool 'internal:merge' for b (binary False symlink False)
   158   picked tool 'internal:merge' for b (binary False symlink False)
   159   merging b and a to b
   159   merging b and a to b
   160   my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
   160   my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
   161    premerge successful
   161    premerge successful
   162   b
   162   b
   163   grafting revision 5
   163   grafting 5:97f8bfe72746 "5"
   164     searching for copies back to rev 1
   164     searching for copies back to rev 1
   165   resolving manifests
   165   resolving manifests
   166    branchmerge: True, force: True, partial: False
   166    branchmerge: True, force: True, partial: False
   167    ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
   167    ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
   168    e: remote is newer -> g
   168    e: remote is newer -> g
   169   getting e
   169   getting e
   170   updating: e 1/1 files (100.00%)
   170   updating: e 1/1 files (100.00%)
   171    b: remote unchanged -> k
   171    b: remote unchanged -> k
   172   e
   172   e
   173   grafting revision 4
   173   grafting 4:9c233e8e184d "4"
   174     searching for copies back to rev 1
   174     searching for copies back to rev 1
   175   resolving manifests
   175   resolving manifests
   176    branchmerge: True, force: True, partial: False
   176    branchmerge: True, force: True, partial: False
   177    ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
   177    ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
   178    preserving e for resolve of e
   178    preserving e for resolve of e
   214   $ hg graft 1 5 4 3 'merge()' 2
   214   $ hg graft 1 5 4 3 'merge()' 2
   215   skipping ungraftable merge revision 6
   215   skipping ungraftable merge revision 6
   216   skipping revision 2 (already grafted to 7)
   216   skipping revision 2 (already grafted to 7)
   217   skipping revision 1 (already grafted to 8)
   217   skipping revision 1 (already grafted to 8)
   218   skipping revision 5 (already grafted to 9)
   218   skipping revision 5 (already grafted to 9)
   219   grafting revision 4
   219   grafting 4:9c233e8e184d "4"
   220   merging e
   220   merging e
   221   warning: conflicts during merge.
   221   warning: conflicts during merge.
   222   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   222   merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
   223   abort: unresolved conflicts, can't continue
   223   abort: unresolved conflicts, can't continue
   224   (use hg resolve and hg graft --continue)
   224   (use hg resolve and hg graft --continue)
   225   [255]
   225   [255]
   226 
   226 
   227 Continue without resolve should fail:
   227 Continue without resolve should fail:
   228 
   228 
   229   $ hg graft -c
   229   $ hg graft -c
   230   grafting revision 4
   230   grafting 4:9c233e8e184d "4"
   231   abort: unresolved merge conflicts (see hg help resolve)
   231   abort: unresolved merge conflicts (see hg help resolve)
   232   [255]
   232   [255]
   233 
   233 
   234 Fix up:
   234 Fix up:
   235 
   235 
   248   [255]
   248   [255]
   249 
   249 
   250 Continue for real, clobber usernames
   250 Continue for real, clobber usernames
   251 
   251 
   252   $ hg graft -c -U
   252   $ hg graft -c -U
   253   grafting revision 4
   253   grafting 4:9c233e8e184d "4"
   254   grafting revision 3
   254   grafting 3:4c60f11aa304 "3"
   255 
   255 
   256 Compare with original:
   256 Compare with original:
   257 
   257 
   258   $ hg diff -r 6
   258   $ hg diff -r 6
   259   $ hg status --rev 0:. -C
   259   $ hg status --rev 0:. -C
   297   $ echo 'g'>g
   297   $ echo 'g'>g
   298   $ hg add g
   298   $ hg add g
   299   $ hg ci -m 7
   299   $ hg ci -m 7
   300   created new head
   300   created new head
   301   $ hg graft 7
   301   $ hg graft 7
   302   grafting revision 7
   302   grafting 7:ef0ef43d49e7 "2"
   303 
   303 
   304   $ hg log -r 7 --template '{rev}:{node}\n'
   304   $ hg log -r 7 --template '{rev}:{node}\n'
   305   7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
   305   7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
   306   $ hg log -r 2 --template '{rev}:{node}\n'
   306   $ hg log -r 2 --template '{rev}:{node}\n'
   307   2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
   307   2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
   348 
   348 
   349 Graft with --log
   349 Graft with --log
   350 
   350 
   351   $ hg up -Cq 1
   351   $ hg up -Cq 1
   352   $ hg graft 3 --log -u foo
   352   $ hg graft 3 --log -u foo
   353   grafting revision 3
   353   grafting 3:4c60f11aa304 "3"
   354   warning: can't find ancestor for 'c' copied from 'b'!
   354   warning: can't find ancestor for 'c' copied from 'b'!
   355   $ hg log --template '{rev} {parents} {desc}\n' -r tip
   355   $ hg log --template '{rev} {parents} {desc}\n' -r tip
   356   14 1:5d205f8b35b6  3
   356   14 1:5d205f8b35b6  3
   357   (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
   357   (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
   358 
   358 
   362   $ hg ci -m 8
   362   $ hg ci -m 8
   363   created new head
   363   created new head
   364   $ echo c > a
   364   $ echo c > a
   365   $ hg ci -m 9
   365   $ hg ci -m 9
   366   $ hg graft 1 --tool internal:fail
   366   $ hg graft 1 --tool internal:fail
   367   grafting revision 1
   367   grafting 1:5d205f8b35b6 "1"
   368   abort: unresolved conflicts, can't continue
   368   abort: unresolved conflicts, can't continue
   369   (use hg resolve and hg graft --continue)
   369   (use hg resolve and hg graft --continue)
   370   [255]
   370   [255]
   371   $ hg resolve --all
   371   $ hg resolve --all
   372   merging a
   372   merging a
   381   >>>>>>> other: 5d205f8b35b6  - bar: 1
   381   >>>>>>> other: 5d205f8b35b6  - bar: 1
   382   $ echo b > a
   382   $ echo b > a
   383   $ hg resolve -m a
   383   $ hg resolve -m a
   384   (no more unresolved files)
   384   (no more unresolved files)
   385   $ hg graft -c
   385   $ hg graft -c
   386   grafting revision 1
   386   grafting 1:5d205f8b35b6 "1"
   387   $ hg export tip --git
   387   $ hg export tip --git
   388   # HG changeset patch
   388   # HG changeset patch
   389   # User bar
   389   # User bar
   390   # Date 0 0
   390   # Date 0 0
   391   #      Thu Jan 01 00:00:00 1970 +0000
   391   #      Thu Jan 01 00:00:00 1970 +0000
   402 
   402 
   403 Resolve conflicted graft with rename
   403 Resolve conflicted graft with rename
   404   $ echo c > a
   404   $ echo c > a
   405   $ hg ci -m 10
   405   $ hg ci -m 10
   406   $ hg graft 2 --tool internal:fail
   406   $ hg graft 2 --tool internal:fail
   407   grafting revision 2
   407   grafting 2:5c095ad7e90f "2"
   408   abort: unresolved conflicts, can't continue
   408   abort: unresolved conflicts, can't continue
   409   (use hg resolve and hg graft --continue)
   409   (use hg resolve and hg graft --continue)
   410   [255]
   410   [255]
   411   $ hg resolve --all
   411   $ hg resolve --all
   412   merging a and b to b
   412   merging a and b to b
   413   (no more unresolved files)
   413   (no more unresolved files)
   414   $ hg graft -c
   414   $ hg graft -c
   415   grafting revision 2
   415   grafting 2:5c095ad7e90f "2"
   416   $ hg export tip --git
   416   $ hg export tip --git
   417   # HG changeset patch
   417   # HG changeset patch
   418   # User test
   418   # User test
   419   # Date 0 0
   419   # Date 0 0
   420   #      Thu Jan 01 00:00:00 1970 +0000
   420   #      Thu Jan 01 00:00:00 1970 +0000
   642 
   642 
   643   $ hg graft 'origin(13) or destination(origin(13))'
   643   $ hg graft 'origin(13) or destination(origin(13))'
   644   skipping ancestor revision 21
   644   skipping ancestor revision 21
   645   skipping ancestor revision 22
   645   skipping ancestor revision 22
   646   skipping revision 2 (already grafted to 22)
   646   skipping revision 2 (already grafted to 22)
   647   grafting revision 7
   647   grafting 7:ef0ef43d49e7 "2"
   648   grafting revision 13
   648   grafting 13:9db0f28fd374 "2"
   649   grafting revision 19
   649   grafting 19:9627f653b421 "2"
   650   merging b
   650   merging b
   651 
   651 
   652 graft with --force (still doesn't graft merges)
   652 graft with --force (still doesn't graft merges)
   653 
   653 
   654   $ hg graft 19 0 6
   654   $ hg graft 19 0 6
   656   skipping ancestor revision 0
   656   skipping ancestor revision 0
   657   skipping already grafted revision 19 (22 also has origin 2)
   657   skipping already grafted revision 19 (22 also has origin 2)
   658   [255]
   658   [255]
   659   $ hg graft 19 0 6 --force
   659   $ hg graft 19 0 6 --force
   660   skipping ungraftable merge revision 6
   660   skipping ungraftable merge revision 6
   661   grafting revision 19
   661   grafting 19:9627f653b421 "2"
   662   merging b
   662   merging b
   663   grafting revision 0
   663   grafting 0:68795b066622 "0"
   664 
   664 
   665 graft --force after backout
   665 graft --force after backout
   666 
   666 
   667   $ echo abc > a
   667   $ echo abc > a
   668   $ hg ci -m 28
   668   $ hg ci -m 28
   671   changeset 29:484c03b8dfa4 backs out changeset 28:6c56f0f7f033
   671   changeset 29:484c03b8dfa4 backs out changeset 28:6c56f0f7f033
   672   $ hg graft 28
   672   $ hg graft 28
   673   skipping ancestor revision 28
   673   skipping ancestor revision 28
   674   [255]
   674   [255]
   675   $ hg graft 28 --force
   675   $ hg graft 28 --force
   676   grafting revision 28
   676   grafting 28:6c56f0f7f033 "28"
   677   merging a
   677   merging a
   678   $ cat a
   678   $ cat a
   679   abc
   679   abc
   680 
   680 
   681 graft --continue after --force
   681 graft --continue after --force
   682 
   682 
   683   $ echo def > a
   683   $ echo def > a
   684   $ hg ci -m 31
   684   $ hg ci -m 31
   685   $ hg graft 28 --force --tool internal:fail
   685   $ hg graft 28 --force --tool internal:fail
   686   grafting revision 28
   686   grafting 28:6c56f0f7f033 "28"
   687   abort: unresolved conflicts, can't continue
   687   abort: unresolved conflicts, can't continue
   688   (use hg resolve and hg graft --continue)
   688   (use hg resolve and hg graft --continue)
   689   [255]
   689   [255]
   690   $ hg resolve --all
   690   $ hg resolve --all
   691   merging a
   691   merging a
   694   [1]
   694   [1]
   695   $ echo abc > a
   695   $ echo abc > a
   696   $ hg resolve -m a
   696   $ hg resolve -m a
   697   (no more unresolved files)
   697   (no more unresolved files)
   698   $ hg graft -c
   698   $ hg graft -c
   699   grafting revision 28
   699   grafting 28:6c56f0f7f033 "28"
   700   $ cat a
   700   $ cat a
   701   abc
   701   abc
   702 
   702 
   703 Continue testing same origin policy, using revision numbers from test above
   703 Continue testing same origin policy, using revision numbers from test above
   704 but do some destructive editing of the repo:
   704 but do some destructive editing of the repo: