##// END OF EJS Templates
graft: use missing ancestors algorithm to find earlier grafts...
Siddharth Agarwal -
r18882:ce8c169a default
parent child Browse files
Show More
@@ -2937,7 +2937,9 b' def graft(ui, repo, *revs, **opts):'
2937
2937
2938 # check ancestors for earlier grafts
2938 # check ancestors for earlier grafts
2939 ui.debug('scanning for duplicate grafts\n')
2939 ui.debug('scanning for duplicate grafts\n')
2940 for ctx in repo.set("::. - ::%ld", revs):
2940
2941 for rev in repo.changelog.findmissingrevs(revs, [crev]):
2942 ctx = repo[rev]
2941 n = ctx.extra().get('source')
2943 n = ctx.extra().get('source')
2942 if n in ids:
2944 if n in ids:
2943 r = repo[n].rev()
2945 r = repo[n].rev()
@@ -2951,7 +2953,7 b' def graft(ui, repo, *revs, **opts):'
2951 elif ctx.hex() in ids:
2953 elif ctx.hex() in ids:
2952 r = ids[ctx.hex()]
2954 r = ids[ctx.hex()]
2953 ui.warn(_('skipping already grafted revision %s '
2955 ui.warn(_('skipping already grafted revision %s '
2954 '(was grafted from %d)\n') % (r, ctx.rev()))
2956 '(was grafted from %d)\n') % (r, rev))
2955 revs.remove(r)
2957 revs.remove(r)
2956 if not revs:
2958 if not revs:
2957 return -1
2959 return -1
General Comments 0
You need to be logged in to leave comments. Login now