hgext/patchbomb.py
changeset 17176 2ab165cf3d8a
parent 16931 ee388b0a6f67
child 17177 ef507130fc92
equal deleted inserted replaced
17175:f76e2196ee70 17176:2ab165cf3d8a
   274     def getoutgoing(dest, revs):
   274     def getoutgoing(dest, revs):
   275         '''Return the revisions present locally but not in dest'''
   275         '''Return the revisions present locally but not in dest'''
   276         dest = ui.expandpath(dest or 'default-push', dest or 'default')
   276         dest = ui.expandpath(dest or 'default-push', dest or 'default')
   277         dest, branches = hg.parseurl(dest)
   277         dest, branches = hg.parseurl(dest)
   278         revs, checkout = hg.addbranchrevs(repo, repo, branches, revs)
   278         revs, checkout = hg.addbranchrevs(repo, repo, branches, revs)
       
   279         if revs:
       
   280             revs = [repo.lookup(rev) for rev in revs]
   279         other = hg.peer(repo, opts, dest)
   281         other = hg.peer(repo, opts, dest)
   280         ui.status(_('comparing with %s\n') % util.hidepassword(dest))
   282         ui.status(_('comparing with %s\n') % util.hidepassword(dest))
   281         common, _anyinc, _heads = discovery.findcommonincoming(repo, other)
   283         repo.ui.pushbuffer()
   282         nodes = revs and map(repo.lookup, revs) or revs
   284         outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
   283         o = repo.changelog.findmissing(common, heads=nodes)
   285         repo.ui.popbuffer()
   284         if not o:
   286         if not outgoing.missing:
   285             ui.status(_("no changes found\n"))
   287             ui.status(_("no changes found\n"))
   286             return []
   288             return []
   287         return [str(repo.changelog.rev(r)) for r in o]
   289         return [str(repo.changelog.rev(r)) for r in outgoing.missing]
   288 
   290 
   289     def getpatches(revs):
   291     def getpatches(revs):
   290         for r in scmutil.revrange(repo, revs):
   292         for r in scmutil.revrange(repo, revs):
   291             output = cStringIO.StringIO()
   293             output = cStringIO.StringIO()
   292             cmdutil.export(repo, [r], fp=output,
   294             cmdutil.export(repo, [r], fp=output,