Show More
@@ -3183,14 +3183,23 b' def graft(ui, repo, *revs, **opts):' | |||||
3183 | ctx = repo[rev] |
|
3183 | ctx = repo[rev] | |
3184 | n = ctx.extra().get('source') |
|
3184 | n = ctx.extra().get('source') | |
3185 | if n in ids: |
|
3185 | if n in ids: | |
3186 | r = repo[n].rev() |
|
3186 | try: | |
|
3187 | r = repo[n].rev() | |||
|
3188 | except error.RepoLookupError: | |||
|
3189 | r = None | |||
3187 | if r in revs: |
|
3190 | if r in revs: | |
3188 | ui.warn(_('skipping revision %s (already grafted to %s)\n') |
|
3191 | ui.warn(_('skipping revision %s (already grafted to %s)\n') | |
3189 | % (r, rev)) |
|
3192 | % (r, rev)) | |
3190 | revs.remove(r) |
|
3193 | revs.remove(r) | |
3191 | elif ids[n] in revs: |
|
3194 | elif ids[n] in revs: | |
3192 | ui.warn(_('skipping already grafted revision %s ' |
|
3195 | if r is None: | |
3193 | '(%s also has origin %d)\n') % (ids[n], rev, r)) |
|
3196 | ui.warn(_('skipping already grafted revision %s ' | |
|
3197 | '(%s also has unknown origin %s)\n') | |||
|
3198 | % (ids[n], rev, n)) | |||
|
3199 | else: | |||
|
3200 | ui.warn(_('skipping already grafted revision %s ' | |||
|
3201 | '(%s also has origin %d)\n') | |||
|
3202 | % (ids[n], rev, r)) | |||
3194 | revs.remove(ids[n]) |
|
3203 | revs.remove(ids[n]) | |
3195 | elif ctx.hex() in ids: |
|
3204 | elif ctx.hex() in ids: | |
3196 | r = ids[ctx.hex()] |
|
3205 | r = ids[ctx.hex()] |
@@ -631,3 +631,15 b' graft works on complex revset' | |||||
631 | grafting revision 13 |
|
631 | grafting revision 13 | |
632 | grafting revision 19 |
|
632 | grafting revision 19 | |
633 | merging b |
|
633 | merging b | |
|
634 | ||||
|
635 | ||||
|
636 | Continue testing same origin policy, using revision numbers from test above | |||
|
637 | but do some destructive editing of the repo: | |||
|
638 | ||||
|
639 | $ hg up -qC 7 | |||
|
640 | $ hg tag -l -r 13 tmp | |||
|
641 | $ hg --config extensions.mq= strip 2 | |||
|
642 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-backup.hg (glob) | |||
|
643 | $ hg graft tmp | |||
|
644 | skipping already grafted revision 8 (2 also has unknown origin 5c095ad7e90f871700f02dd1fa5012cb4498a2d4) | |||
|
645 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now