Patchwork [2,of,5] patchbomb: return outgoing revs as a smartset

login
register
mail settings
Submitter Yuya Nishihara
Date April 1, 2015, 1:25 p.m.
Message ID <1783b7e927eb2e83541d.1427894751@mimosa>
Download mbox | patch
Permalink /patch/8411/
State Accepted
Headers show

Comments

Yuya Nishihara - April 1, 2015, 1:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1427730737 -32400
#      Tue Mar 31 00:52:17 2015 +0900
# Node ID 1783b7e927eb2e83541d88b364312dd6c3919d66
# Parent  8df3899c929cb405b0370b9538b6cb1e73062bc8
patchbomb: return outgoing revs as a smartset

This helps to factor out scmutil.revrange() calls from _getpatches() and
_getoutgoing(). In future patches, a smartset will be passed to _getpatches().

Patch

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -345,8 +345,7 @@  def _getoutgoing(repo, dest, revs):
     revs = repo.revs('outgoing(%s) and ::%ld', dest or '', revs)
     if not revs:
         ui.status(_("no changes found\n"))
-        return []
-    return [str(r) for r in revs]
+    return revs
 
 emailopts = [
     ('', 'body', None, _('send patches as inline message text (default)')),
@@ -503,7 +502,7 @@  def patchbomb(ui, repo, *revs, **opts):
     if outgoing:
         revs = _getoutgoing(repo, dest, rev)
     if bundle:
-        opts['revs'] = revs
+        opts['revs'] = [str(r) for r in revs]
 
     # start
     if date:
@@ -527,6 +526,7 @@  def patchbomb(ui, repo, *revs, **opts):
         bundleopts.pop('bundle', None)  # already processed
         msgs = _getbundlemsgs(repo, sender, bundledata, **bundleopts)
     else:
+        revs = [str(r) for r in revs]
         _patches = list(_getpatches(repo, revs, **opts))
         msgs = _getpatchmsgs(repo, sender, _patches, **opts)