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

login
register
mail settings
Submitter Boris Feld
Date Jan. 17, 2018, 6:33 p.m.
Message ID <f345503e9327bb9a2967.1516214032@FB>
Download mbox | patch
Permalink /patch/26821/
State Accepted
Headers show

Comments

Boris Feld - Jan. 17, 2018, 6:33 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.

Patch

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"))