diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py --- a/hgext/convert/__init__.py +++ b/hgext/convert/__init__.py @@ -127,7 +127,7 @@ def convert(ui, src, dest=None, revmapfi matched. If a match occurs, then the conversion process will add the most recent revision on the branch indicated in the regex as the second parent of the changeset. - + The hgext/convert/cvsps wrapper script allows the builtin changeset merging code to be run without doing a conversion. Its parameters and output are similar to that of cvsps 2.1. diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -212,7 +212,7 @@ class mercurial_source(converter_source) try: startnode = self.repo.lookup(startnode) except repo.RepoError: - raise util.Abort(_('%s is not a valid start revision') + raise util.Abort(_('%s is not a valid start revision') % startnode) startrev = self.repo.changelog.rev(startnode) children = {startnode: 1} @@ -229,7 +229,7 @@ class mercurial_source(converter_source) return self.lastctx def parents(self, ctx): - return [p.node() for p in ctx.parents() + return [p.node() for p in ctx.parents() if p and self.keep(p.node())] def getheads(self): diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -86,7 +86,7 @@ def rebase(ui, repo, **opts): ui.note(_('rebase merging completed\n')) if collapsef: - p1, p2 = defineparents(repo, min(state), target, + p1, p2 = defineparents(repo, min(state), target, state, targetancestors) concludenode(repo, rev, p1, external, state, collapsef, last=True, skipped=skipped) @@ -96,7 +96,7 @@ def rebase(ui, repo, **opts): if not opts.get('keep'): # Remove no more useful revisions - if (util.set(repo.changelog.descendants(min(state))) + if (util.set(repo.changelog.descendants(min(state))) - util.set(state.keys())): ui.warn(_("warning: new changesets detected on source branch, " "not stripping\n")) @@ -174,7 +174,7 @@ def rebasenode(repo, rev, target, state, repo.ui.debug('next revision set to %s\n' % p1) skipped[rev] = True state[rev] = p1 - + def defineparents(repo, rev, target, state, targetancestors): 'Return the new parent relationship of the revision that will be rebased' parents = repo[rev].parents() @@ -224,7 +224,7 @@ def updatemq(repo, state, skipped, **opt if rev not in skipped: repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], mqrebase[rev])) - repo.mq.qimport(repo, (), patchname=mqrebase[rev], + repo.mq.qimport(repo, (), patchname=mqrebase[rev], git=opts.get('git', False),rev=[str(state[rev])]) repo.mq.save_dirty() @@ -330,7 +330,7 @@ def buildstate(repo, dest, src, base, co cwdancestors.add(cwd) rebasingbranch = cwdancestors - targetancestors source = min(rebasingbranch) - + repo.ui.debug(_('rebase onto %d starting from %d\n') % (dest, source)) state = dict.fromkeys(repo.changelog.descendants(source), nullrev) external = nullrev @@ -379,7 +379,7 @@ def uisetup(ui): # make sure 'hg help cmd' still works decorator.__doc__ = cmdentry[0].__doc__ decoratorentry = (decorator,) + cmdentry[1:] - rebaseopt = ('', 'rebase', None, + rebaseopt = ('', 'rebase', None, _("rebase working directory to branch head")) decoratorentry[1].append(rebaseopt) commands.table[cmdkey] = decoratorentry diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -707,7 +707,7 @@ class localrepository(repo.repository): if not cr: self.ui.debug(_(" %s: searching for copy revision for %s\n") % (fn, cf)) - for a in self['.'].ancestors(): + for a in self['.'].ancestors(): if cf in a: cr = a[cf].filenode() break diff --git a/tests/test-convert.out b/tests/test-convert.out --- a/tests/test-convert.out +++ b/tests/test-convert.out @@ -115,7 +115,7 @@ Convert a foreign SCM repository to a Me matched. If a match occurs, then the conversion process will add the most recent revision on the branch indicated in the regex as the second parent of the changeset. - + The hgext/convert/cvsps wrapper script allows the builtin changeset merging code to be run without doing a conversion. Its parameters and output are similar to that of cvsps 2.1. diff --git a/tests/test-revlog-ancestry.py b/tests/test-revlog-ancestry.py --- a/tests/test-revlog-ancestry.py +++ b/tests/test-revlog-ancestry.py @@ -49,26 +49,26 @@ if __name__ == '__main__': # Ancestors print 'Ancestors of 5' for r in repo.changelog.ancestors(5): - print r, + print r, print '\nAncestors of 6 and 5' for r in repo.changelog.ancestors(6, 5): - print r, + print r, print '\nAncestors of 5 and 4' for r in repo.changelog.ancestors(5, 4): - print r, + print r, # Descendants print '\n\nDescendants of 5' for r in repo.changelog.descendants(5): - print r, + print r, print '\nDescendants of 5 and 3' for r in repo.changelog.descendants(5, 3): - print r, + print r, print '\nDescendants of 5 and 4' for r in repo.changelog.descendants(5, 4): - print r, + print r,