Show More
@@ -127,7 +127,7 b' def convert(ui, src, dest=None, revmapfi' | |||||
127 | matched. If a match occurs, then the conversion process will |
|
127 | matched. If a match occurs, then the conversion process will | |
128 | add the most recent revision on the branch indicated in the |
|
128 | add the most recent revision on the branch indicated in the | |
129 | regex as the second parent of the changeset. |
|
129 | regex as the second parent of the changeset. | |
130 |
|
130 | |||
131 | The hgext/convert/cvsps wrapper script allows the builtin changeset |
|
131 | The hgext/convert/cvsps wrapper script allows the builtin changeset | |
132 | merging code to be run without doing a conversion. Its parameters and |
|
132 | merging code to be run without doing a conversion. Its parameters and | |
133 | output are similar to that of cvsps 2.1. |
|
133 | output are similar to that of cvsps 2.1. |
@@ -212,7 +212,7 b' class mercurial_source(converter_source)' | |||||
212 | try: |
|
212 | try: | |
213 | startnode = self.repo.lookup(startnode) |
|
213 | startnode = self.repo.lookup(startnode) | |
214 | except repo.RepoError: |
|
214 | except repo.RepoError: | |
215 |
raise util.Abort(_('%s is not a valid start revision') |
|
215 | raise util.Abort(_('%s is not a valid start revision') | |
216 | % startnode) |
|
216 | % startnode) | |
217 | startrev = self.repo.changelog.rev(startnode) |
|
217 | startrev = self.repo.changelog.rev(startnode) | |
218 | children = {startnode: 1} |
|
218 | children = {startnode: 1} | |
@@ -229,7 +229,7 b' class mercurial_source(converter_source)' | |||||
229 | return self.lastctx |
|
229 | return self.lastctx | |
230 |
|
230 | |||
231 | def parents(self, ctx): |
|
231 | def parents(self, ctx): | |
232 |
return [p.node() for p in ctx.parents() |
|
232 | return [p.node() for p in ctx.parents() | |
233 | if p and self.keep(p.node())] |
|
233 | if p and self.keep(p.node())] | |
234 |
|
234 | |||
235 | def getheads(self): |
|
235 | def getheads(self): |
@@ -86,7 +86,7 b' def rebase(ui, repo, **opts):' | |||||
86 | ui.note(_('rebase merging completed\n')) |
|
86 | ui.note(_('rebase merging completed\n')) | |
87 |
|
87 | |||
88 | if collapsef: |
|
88 | if collapsef: | |
89 |
p1, p2 = defineparents(repo, min(state), target, |
|
89 | p1, p2 = defineparents(repo, min(state), target, | |
90 | state, targetancestors) |
|
90 | state, targetancestors) | |
91 | concludenode(repo, rev, p1, external, state, collapsef, |
|
91 | concludenode(repo, rev, p1, external, state, collapsef, | |
92 | last=True, skipped=skipped) |
|
92 | last=True, skipped=skipped) | |
@@ -96,7 +96,7 b' def rebase(ui, repo, **opts):' | |||||
96 |
|
96 | |||
97 | if not opts.get('keep'): |
|
97 | if not opts.get('keep'): | |
98 | # Remove no more useful revisions |
|
98 | # Remove no more useful revisions | |
99 |
if (util.set(repo.changelog.descendants(min(state))) |
|
99 | if (util.set(repo.changelog.descendants(min(state))) | |
100 | - util.set(state.keys())): |
|
100 | - util.set(state.keys())): | |
101 | ui.warn(_("warning: new changesets detected on source branch, " |
|
101 | ui.warn(_("warning: new changesets detected on source branch, " | |
102 | "not stripping\n")) |
|
102 | "not stripping\n")) | |
@@ -174,7 +174,7 b' def rebasenode(repo, rev, target, state,' | |||||
174 | repo.ui.debug('next revision set to %s\n' % p1) |
|
174 | repo.ui.debug('next revision set to %s\n' % p1) | |
175 | skipped[rev] = True |
|
175 | skipped[rev] = True | |
176 | state[rev] = p1 |
|
176 | state[rev] = p1 | |
177 |
|
177 | |||
178 | def defineparents(repo, rev, target, state, targetancestors): |
|
178 | def defineparents(repo, rev, target, state, targetancestors): | |
179 | 'Return the new parent relationship of the revision that will be rebased' |
|
179 | 'Return the new parent relationship of the revision that will be rebased' | |
180 | parents = repo[rev].parents() |
|
180 | parents = repo[rev].parents() | |
@@ -224,7 +224,7 b' def updatemq(repo, state, skipped, **opt' | |||||
224 | if rev not in skipped: |
|
224 | if rev not in skipped: | |
225 | repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], |
|
225 | repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], | |
226 | mqrebase[rev])) |
|
226 | mqrebase[rev])) | |
227 |
repo.mq.qimport(repo, (), patchname=mqrebase[rev], |
|
227 | repo.mq.qimport(repo, (), patchname=mqrebase[rev], | |
228 | git=opts.get('git', False),rev=[str(state[rev])]) |
|
228 | git=opts.get('git', False),rev=[str(state[rev])]) | |
229 | repo.mq.save_dirty() |
|
229 | repo.mq.save_dirty() | |
230 |
|
230 | |||
@@ -330,7 +330,7 b' def buildstate(repo, dest, src, base, co' | |||||
330 | cwdancestors.add(cwd) |
|
330 | cwdancestors.add(cwd) | |
331 | rebasingbranch = cwdancestors - targetancestors |
|
331 | rebasingbranch = cwdancestors - targetancestors | |
332 | source = min(rebasingbranch) |
|
332 | source = min(rebasingbranch) | |
333 |
|
333 | |||
334 | repo.ui.debug(_('rebase onto %d starting from %d\n') % (dest, source)) |
|
334 | repo.ui.debug(_('rebase onto %d starting from %d\n') % (dest, source)) | |
335 | state = dict.fromkeys(repo.changelog.descendants(source), nullrev) |
|
335 | state = dict.fromkeys(repo.changelog.descendants(source), nullrev) | |
336 | external = nullrev |
|
336 | external = nullrev | |
@@ -379,7 +379,7 b' def uisetup(ui):' | |||||
379 | # make sure 'hg help cmd' still works |
|
379 | # make sure 'hg help cmd' still works | |
380 | decorator.__doc__ = cmdentry[0].__doc__ |
|
380 | decorator.__doc__ = cmdentry[0].__doc__ | |
381 | decoratorentry = (decorator,) + cmdentry[1:] |
|
381 | decoratorentry = (decorator,) + cmdentry[1:] | |
382 |
rebaseopt = ('', 'rebase', None, |
|
382 | rebaseopt = ('', 'rebase', None, | |
383 | _("rebase working directory to branch head")) |
|
383 | _("rebase working directory to branch head")) | |
384 | decoratorentry[1].append(rebaseopt) |
|
384 | decoratorentry[1].append(rebaseopt) | |
385 | commands.table[cmdkey] = decoratorentry |
|
385 | commands.table[cmdkey] = decoratorentry |
@@ -707,7 +707,7 b' class localrepository(repo.repository):' | |||||
707 | if not cr: |
|
707 | if not cr: | |
708 | self.ui.debug(_(" %s: searching for copy revision for %s\n") % |
|
708 | self.ui.debug(_(" %s: searching for copy revision for %s\n") % | |
709 | (fn, cf)) |
|
709 | (fn, cf)) | |
710 |
|
|
710 | for a in self['.'].ancestors(): | |
711 | if cf in a: |
|
711 | if cf in a: | |
712 | cr = a[cf].filenode() |
|
712 | cr = a[cf].filenode() | |
713 | break |
|
713 | break |
@@ -115,7 +115,7 b' Convert a foreign SCM repository to a Me' | |||||
115 | matched. If a match occurs, then the conversion process will |
|
115 | matched. If a match occurs, then the conversion process will | |
116 | add the most recent revision on the branch indicated in the |
|
116 | add the most recent revision on the branch indicated in the | |
117 | regex as the second parent of the changeset. |
|
117 | regex as the second parent of the changeset. | |
118 |
|
118 | |||
119 | The hgext/convert/cvsps wrapper script allows the builtin changeset |
|
119 | The hgext/convert/cvsps wrapper script allows the builtin changeset | |
120 | merging code to be run without doing a conversion. Its parameters and |
|
120 | merging code to be run without doing a conversion. Its parameters and | |
121 | output are similar to that of cvsps 2.1. |
|
121 | output are similar to that of cvsps 2.1. |
@@ -49,26 +49,26 b" if __name__ == '__main__':" | |||||
49 | # Ancestors |
|
49 | # Ancestors | |
50 | print 'Ancestors of 5' |
|
50 | print 'Ancestors of 5' | |
51 | for r in repo.changelog.ancestors(5): |
|
51 | for r in repo.changelog.ancestors(5): | |
52 |
print r, |
|
52 | print r, | |
53 |
|
53 | |||
54 | print '\nAncestors of 6 and 5' |
|
54 | print '\nAncestors of 6 and 5' | |
55 | for r in repo.changelog.ancestors(6, 5): |
|
55 | for r in repo.changelog.ancestors(6, 5): | |
56 |
print r, |
|
56 | print r, | |
57 |
|
57 | |||
58 | print '\nAncestors of 5 and 4' |
|
58 | print '\nAncestors of 5 and 4' | |
59 | for r in repo.changelog.ancestors(5, 4): |
|
59 | for r in repo.changelog.ancestors(5, 4): | |
60 |
print r, |
|
60 | print r, | |
61 |
|
61 | |||
62 | # Descendants |
|
62 | # Descendants | |
63 | print '\n\nDescendants of 5' |
|
63 | print '\n\nDescendants of 5' | |
64 | for r in repo.changelog.descendants(5): |
|
64 | for r in repo.changelog.descendants(5): | |
65 |
print r, |
|
65 | print r, | |
66 |
|
66 | |||
67 | print '\nDescendants of 5 and 3' |
|
67 | print '\nDescendants of 5 and 3' | |
68 | for r in repo.changelog.descendants(5, 3): |
|
68 | for r in repo.changelog.descendants(5, 3): | |
69 |
print r, |
|
69 | print r, | |
70 |
|
70 | |||
71 | print '\nDescendants of 5 and 4' |
|
71 | print '\nDescendants of 5 and 4' | |
72 | for r in repo.changelog.descendants(5, 4): |
|
72 | for r in repo.changelog.descendants(5, 4): | |
73 |
print r, |
|
73 | print r, | |
74 |
|
74 |
General Comments 0
You need to be logged in to leave comments.
Login now