##// END OF EJS Templates
patchbomb: rewrite getoutgoing() with revsets...
Patrick Mezard -
r17178:8308f628 default
parent child Browse files
Show More
@@ -48,7 +48,7 b' hgrc(5) for details.'
48 48 import os, errno, socket, tempfile, cStringIO
49 49 import email.MIMEMultipart, email.MIMEBase
50 50 import email.Utils, email.Encoders, email.Generator
51 from mercurial import cmdutil, commands, hg, mail, patch, util, discovery
51 from mercurial import cmdutil, commands, hg, mail, patch, util
52 52 from mercurial import scmutil
53 53 from mercurial.i18n import _
54 54 from mercurial.node import bin
@@ -273,20 +273,18 b' def patchbomb(ui, repo, *revs, **opts):'
273 273
274 274 def getoutgoing(dest, revs):
275 275 '''Return the revisions present locally but not in dest'''
276 dest = ui.expandpath(dest or 'default-push', dest or 'default')
277 dest, branches = hg.parseurl(dest)
278 revs, checkout = hg.addbranchrevs(repo, repo, branches, revs)
279 if revs:
280 revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]
281 other = hg.peer(repo, opts, dest)
282 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
283 repo.ui.pushbuffer()
284 outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
285 repo.ui.popbuffer()
286 if not outgoing.missing:
276 url = ui.expandpath(dest or 'default-push', dest or 'default')
277 url = hg.parseurl(url)[0]
278 ui.status(_('comparing with %s\n') % util.hidepassword(url))
279
280 revs = [r for r in scmutil.revrange(repo, revs) if r >= 0]
281 if not revs:
282 revs = [len(repo) - 1]
283 revs = repo.revs('outgoing(%s) and ::%ld', dest or '', revs)
284 if not revs:
287 285 ui.status(_("no changes found\n"))
288 286 return []
289 return [str(repo.changelog.rev(r)) for r in outgoing.missing]
287 return [str(r) for r in revs]
290 288
291 289 def getpatches(revs):
292 290 for r in scmutil.revrange(repo, revs):
General Comments 0
You need to be logged in to leave comments. Login now