patchbomb: return outgoing revs as a smartset
authorYuya Nishihara <yuya@tcha.org>
Tue, 31 Mar 2015 00:52:17 +0900
changeset 24567 13f0af2a5a4c
parent 24566 6abce80e6cbf
child 24568 2e5f6cdf01f6
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().
hgext/patchbomb.py
--- a/hgext/patchbomb.py	Mon Mar 30 23:54:29 2015 +0900
+++ b/hgext/patchbomb.py	Tue Mar 31 00:52:17 2015 +0900
@@ -345,8 +345,7 @@
     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 @@
     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 @@
         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)