[PATCH 4 of 5] patchbomb: use 'tiprev' when appropriate

Boris Feld boris.feld at octobus.net
Wed Jan 17 13:33:52 EST 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1516190498 -3600
#      Wed Jan 17 13:01:38 2018 +0100
# Node ID f345503e9327bb9a2967f5f75b3a49ecb302afc0
# Parent  4edcd11f51c89f603cfdc740d229d141bf544f81
# EXP-Topic tiprev
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r f345503e9327
patchbomb: use 'tiprev' when appropriate

This is cleaner than the current 'len(repo) - 1' form.

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -454,7 +454,7 @@ def _getoutgoing(repo, dest, revs):
 
     revs = [r for r in revs if r >= 0]
     if not revs:
-        revs = [len(repo) - 1]
+        revs = [repo.changelog.tiprev()]
     revs = repo.revs('outgoing(%s) and ::%ld', dest or '', revs)
     if not revs:
         ui.status(_("no changes found\n"))


More information about the Mercurial-devel mailing list