Show More
@@ -651,6 +651,9 b' def tryimportone(ui, repo, hunk, parents' | |||||
651 | p2 = repo[nullid] |
|
651 | p2 = repo[nullid] | |
652 | except error.RepoError: |
|
652 | except error.RepoError: | |
653 | p1, p2 = parents |
|
653 | p1, p2 = parents | |
|
654 | if p2.node() == nullid: | |||
|
655 | ui.warn(_("warning: import the patch as a normal revision\n" | |||
|
656 | "(use --exact to import the patch as a merge)\n")) | |||
654 | else: |
|
657 | else: | |
655 | p1, p2 = parents |
|
658 | p1, p2 = parents | |
656 |
|
659 | |||
@@ -911,9 +914,10 b' class changeset_printer(object):' | |||||
911 | self.ui.write(_("phase: %s\n") % _(ctx.phasestr()), |
|
914 | self.ui.write(_("phase: %s\n") % _(ctx.phasestr()), | |
912 | label='log.phase') |
|
915 | label='log.phase') | |
913 | for parent in parents: |
|
916 | for parent in parents: | |
|
917 | label = 'log.parent changeset.%s' % self.repo[parent[0]].phasestr() | |||
914 | # i18n: column positioning for "hg log" |
|
918 | # i18n: column positioning for "hg log" | |
915 | self.ui.write(_("parent: %d:%s\n") % parent, |
|
919 | self.ui.write(_("parent: %d:%s\n") % parent, | |
916 |
label= |
|
920 | label=label) | |
917 |
|
921 | |||
918 | if self.ui.debugflag: |
|
922 | if self.ui.debugflag: | |
919 | mnode = ctx.manifestnode() |
|
923 | mnode = ctx.manifestnode() |
@@ -3221,14 +3221,23 b' def graft(ui, repo, *revs, **opts):' | |||||
3221 | ctx = repo[rev] |
|
3221 | ctx = repo[rev] | |
3222 | n = ctx.extra().get('source') |
|
3222 | n = ctx.extra().get('source') | |
3223 | if n in ids: |
|
3223 | if n in ids: | |
3224 |
|
|
3224 | try: | |
|
3225 | r = repo[n].rev() | |||
|
3226 | except error.RepoLookupError: | |||
|
3227 | r = None | |||
3225 | if r in revs: |
|
3228 | if r in revs: | |
3226 | ui.warn(_('skipping revision %s (already grafted to %s)\n') |
|
3229 | ui.warn(_('skipping revision %s (already grafted to %s)\n') | |
3227 | % (r, rev)) |
|
3230 | % (r, rev)) | |
3228 | revs.remove(r) |
|
3231 | revs.remove(r) | |
3229 | elif ids[n] in revs: |
|
3232 | elif ids[n] in revs: | |
3230 | ui.warn(_('skipping already grafted revision %s ' |
|
3233 | if r is None: | |
3231 | '(%s also has origin %d)\n') % (ids[n], rev, r)) |
|
3234 | ui.warn(_('skipping already grafted revision %s ' | |
|
3235 | '(%s also has unknown origin %s)\n') | |||
|
3236 | % (ids[n], rev, n)) | |||
|
3237 | else: | |||
|
3238 | ui.warn(_('skipping already grafted revision %s ' | |||
|
3239 | '(%s also has origin %d)\n') | |||
|
3240 | % (ids[n], rev, r)) | |||
3232 | revs.remove(ids[n]) |
|
3241 | revs.remove(ids[n]) | |
3233 | elif ctx.hex() in ids: |
|
3242 | elif ctx.hex() in ids: | |
3234 | r = ids[ctx.hex()] |
|
3243 | r = ids[ctx.hex()] |
@@ -678,3 +678,14 b' graft --continue after --force' | |||||
678 | grafting revision 28 |
|
678 | grafting revision 28 | |
679 | $ cat a |
|
679 | $ cat a | |
680 | abc |
|
680 | abc | |
|
681 | ||||
|
682 | Continue testing same origin policy, using revision numbers from test above | |||
|
683 | but do some destructive editing of the repo: | |||
|
684 | ||||
|
685 | $ hg up -qC 7 | |||
|
686 | $ hg tag -l -r 13 tmp | |||
|
687 | $ hg --config extensions.mq= strip 2 | |||
|
688 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-backup.hg (glob) | |||
|
689 | $ hg graft tmp | |||
|
690 | skipping already grafted revision 8 (2 also has unknown origin 5c095ad7e90f871700f02dd1fa5012cb4498a2d4) | |||
|
691 | [255] |
@@ -72,6 +72,8 b' Test without --exact and diff.p1 != work' | |||||
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 | $ hg import ../merge.diff |
|
73 | $ hg import ../merge.diff | |
74 | applying ../merge.diff |
|
74 | applying ../merge.diff | |
|
75 | warning: import the patch as a normal revision | |||
|
76 | (use --exact to import the patch as a merge) | |||
75 | $ tipparents |
|
77 | $ tipparents | |
76 | 2:890ecaa90481 addc |
|
78 | 2:890ecaa90481 addc | |
77 | $ hg strip --no-backup tip |
|
79 | $ hg strip --no-backup tip | |
@@ -105,6 +107,8 b' Test with --bypass and diff.p1 != workin' | |||||
105 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
106 | $ hg import --bypass ../merge.diff |
|
108 | $ hg import --bypass ../merge.diff | |
107 | applying ../merge.diff |
|
109 | applying ../merge.diff | |
|
110 | warning: import the patch as a normal revision | |||
|
111 | (use --exact to import the patch as a merge) | |||
108 | $ tipparents |
|
112 | $ tipparents | |
109 | 2:890ecaa90481 addc |
|
113 | 2:890ecaa90481 addc | |
110 | $ hg strip --no-backup tip |
|
114 | $ hg strip --no-backup tip |
General Comments 0
You need to be logged in to leave comments.
Login now