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