Show More
@@ -69,7 +69,8 class transplanter: | |||
|
69 | 69 | self.ui = ui |
|
70 | 70 | self.path = repo.join('transplant') |
|
71 | 71 | self.opener = util.opener(self.path) |
|
72 |
self.transplants = transplants(self.path, 'transplants', |
|
|
72 | self.transplants = transplants(self.path, 'transplants', | |
|
73 | opener=self.opener) | |
|
73 | 74 | |
|
74 | 75 | def applied(self, repo, node, parent): |
|
75 | 76 | '''returns True if a node is already an ancestor of parent |
@@ -109,8 +110,8 class transplanter: | |||
|
109 | 110 | |
|
110 | 111 | parents = source.changelog.parents(node) |
|
111 | 112 | if not opts.get('filter'): |
|
112 |
# If the changeset parent is the same as the |
|
|
113 | # just pull it. | |
|
113 | # If the changeset parent is the same as the | |
|
114 | # wdir's parent, just pull it. | |
|
114 | 115 | if parents[0] == p1: |
|
115 | 116 | pulls.append(node) |
|
116 | 117 | p1 = node |
@@ -124,9 +125,9 class transplanter: | |||
|
124 | 125 | |
|
125 | 126 | domerge = False |
|
126 | 127 | if node in merges: |
|
127 |
# pulling all the merge revs at once would mean we |
|
|
128 |
# transplant after the latest even if |
|
|
129 | # fail. | |
|
128 | # pulling all the merge revs at once would mean we | |
|
129 | # couldn't transplant after the latest even if | |
|
130 | # transplants before them fail. | |
|
130 | 131 | domerge = True |
|
131 | 132 | if not hasnode(repo, node): |
|
132 | 133 | repo.pull(source, heads=[node]) |
@@ -155,8 +156,9 class transplanter: | |||
|
155 | 156 | self.ui.status(_('%s merged at %s\n') % (revstr, |
|
156 | 157 | revlog.short(n))) |
|
157 | 158 | elif n: |
|
158 |
self.ui.status(_('%s transplanted to %s\n') |
|
|
159 |
|
|
|
159 | self.ui.status(_('%s transplanted to %s\n') | |
|
160 | % (revlog.short(node), | |
|
161 | revlog.short(n))) | |
|
160 | 162 | finally: |
|
161 | 163 | if patchfile: |
|
162 | 164 | os.unlink(patchfile) |
@@ -217,7 +219,8 class transplanter: | |||
|
217 | 219 | fuzz = patch.patch(patchfile, self.ui, cwd=repo.root, |
|
218 | 220 | files=files) |
|
219 | 221 | if not files: |
|
220 |
self.ui.warn(_('%s: empty changeset') |
|
|
222 | self.ui.warn(_('%s: empty changeset') | |
|
223 | % revlog.hex(node)) | |
|
221 | 224 | return None |
|
222 | 225 | finally: |
|
223 | 226 | files = patch.updatedir(self.ui, repo, files) |
@@ -231,7 +234,8 class transplanter: | |||
|
231 | 234 | p2 = node |
|
232 | 235 | self.log(user, date, message, p1, p2, merge=merge) |
|
233 | 236 | self.ui.write(str(inst) + '\n') |
|
234 |
raise util.Abort(_('Fix up the merge and run |
|
|
237 | raise util.Abort(_('Fix up the merge and run ' | |
|
238 | 'hg transplant --continue')) | |
|
235 | 239 | else: |
|
236 | 240 | files = None |
|
237 | 241 | if merge: |
@@ -496,16 +500,19 def transplant(ui, repo, *revs, **opts): | |||
|
496 | 500 | def checkopts(opts, revs): |
|
497 | 501 | if opts.get('continue'): |
|
498 | 502 | if filter(lambda opt: opts.get(opt), ('branch', 'all', 'merge')): |
|
499 |
raise util.Abort(_('--continue is incompatible with |
|
|
503 | raise util.Abort(_('--continue is incompatible with ' | |
|
504 | 'branch, all or merge')) | |
|
500 | 505 | return |
|
501 | 506 | if not (opts.get('source') or revs or |
|
502 | 507 | opts.get('merge') or opts.get('branch')): |
|
503 |
raise util.Abort(_('no source URL, branch tag or revision |
|
|
508 | raise util.Abort(_('no source URL, branch tag or revision ' | |
|
509 | 'list provided')) | |
|
504 | 510 | if opts.get('all'): |
|
505 | 511 | if not opts.get('branch'): |
|
506 | 512 | raise util.Abort(_('--all requires a branch revision')) |
|
507 | 513 | if revs: |
|
508 |
raise util.Abort(_('--all is incompatible with a |
|
|
514 | raise util.Abort(_('--all is incompatible with a ' | |
|
515 | 'revision list')) | |
|
509 | 516 | |
|
510 | 517 | checkopts(opts, revs) |
|
511 | 518 | |
@@ -553,9 +560,11 def transplant(ui, repo, *revs, **opts): | |||
|
553 | 560 | revmap[int(r)] = source.lookup(r) |
|
554 | 561 | elif opts.get('all') or not merges: |
|
555 | 562 | if source != repo: |
|
556 |
alltransplants = incwalk(source, incoming, branches, |
|
|
563 | alltransplants = incwalk(source, incoming, branches, | |
|
564 | match=matchfn) | |
|
557 | 565 | else: |
|
558 |
alltransplants = transplantwalk(source, p1, branches, |
|
|
566 | alltransplants = transplantwalk(source, p1, branches, | |
|
567 | match=matchfn) | |
|
559 | 568 | if opts.get('all'): |
|
560 | 569 | revs = alltransplants |
|
561 | 570 | else: |
@@ -581,7 +590,9 cmdtable = { | |||
|
581 | 590 | ('p', 'prune', [], _('skip over REV')), |
|
582 | 591 | ('m', 'merge', [], _('merge at REV')), |
|
583 | 592 | ('', 'log', None, _('append transplant info to log message')), |
|
584 |
('c', 'continue', None, _('continue last transplant session |
|
|
593 | ('c', 'continue', None, _('continue last transplant session ' | |
|
594 | 'after repair')), | |
|
585 | 595 | ('', 'filter', '', _('filter changesets through FILTER'))], |
|
586 |
_('hg transplant [-s REPOSITORY] [-b BRANCH [-a]] [-p REV] |
|
|
596 | _('hg transplant [-s REPOSITORY] [-b BRANCH [-a]] [-p REV] ' | |
|
597 | '[-m REV] [REV]...')) | |
|
587 | 598 | } |
General Comments 0
You need to be logged in to leave comments.
Login now