comparison mercurial/revset.py @ 12614:f314723f36f5 stable

revset: fix #branch in urls for outgoing() hg log -r 'outgoing(..)' ignored #branch in some cases. This patch fixes it. The cases where it misbehaved are now covered by the added test-revset-outgoing.t
author Adrian Buehlmann <adrian@cadifra.com>
date Tue, 05 Oct 2010 11:34:13 +0200
parents 40c40c6f20b8
children 64db820c66a2
comparison
equal deleted inserted replaced
12611:1f6bd49383b3 12614:f314723f36f5
433 import hg # avoid start-up nasties 433 import hg # avoid start-up nasties
434 l = getargs(x, 0, 1, _("outgoing wants a repository path")) 434 l = getargs(x, 0, 1, _("outgoing wants a repository path"))
435 dest = l and getstring(l[0], _("outgoing wants a repository path")) or '' 435 dest = l and getstring(l[0], _("outgoing wants a repository path")) or ''
436 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default') 436 dest = repo.ui.expandpath(dest or 'default-push', dest or 'default')
437 dest, branches = hg.parseurl(dest) 437 dest, branches = hg.parseurl(dest)
438 revs, checkout = hg.addbranchrevs(repo, repo, branches, [])
439 if revs:
440 revs = [repo.lookup(rev) for rev in revs]
438 other = hg.repository(hg.remoteui(repo, {}), dest) 441 other = hg.repository(hg.remoteui(repo, {}), dest)
439 repo.ui.pushbuffer() 442 repo.ui.pushbuffer()
440 o = discovery.findoutgoing(repo, other) 443 o = discovery.findoutgoing(repo, other)
441 repo.ui.popbuffer() 444 repo.ui.popbuffer()
442 cl = repo.changelog 445 cl = repo.changelog
443 o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, None)[0]]) 446 o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, revs)[0]])
444 return [r for r in subset if r in o] 447 return [r for r in subset if r in o]
445 448
446 def tagged(repo, subset, x): 449 def tagged(repo, subset, x):
447 getargs(x, 0, 0, _("tagged takes no arguments")) 450 getargs(x, 0, 0, _("tagged takes no arguments"))
448 cl = repo.changelog 451 cl = repo.changelog