Patchwork [evolve-ext] prune: reuse revset from repair instead of copy-pasting code

login
register
mail settings
Submitter Ryan McElroy
Date Oct. 13, 2015, 6:34 a.m.
Message ID <b2c9405678f70f2d09e7.1444718060@devbig314.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11006/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Ryan McElroy - Oct. 13, 2015, 6:34 a.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1444432890 25200
#      Fri Oct 09 16:21:30 2015 -0700
# Branch stable
# Node ID b2c9405678f70f2d09e773dbc35ad77d96a4dcb9
# Parent  91b6a30424a366e87771fc2544c95633f4abfe81
prune: reuse revset from repair instead of copy-pasting code
Pierre-Yves David - Oct. 14, 2015, 4:08 a.m.
On 10/12/2015 11:34 PM, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy@fb.com>
> # Date 1444432890 25200
> #      Fri Oct 09 16:21:30 2015 -0700
> # Branch stable
> # Node ID b2c9405678f70f2d09e773dbc35ad77d96a4dcb9
> # Parent  91b6a30424a366e87771fc2544c95633f4abfe81
> prune: reuse revset from repair instead of copy-pasting code

Pushed to main thanks.

I've kept the old code for old Mercurial version.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -71,6 +71,7 @@  sha1re = re.compile(r'\b[0-9a-f]{6,40}\b
 
 import mercurial
 from mercurial import util
+from mercurial import repair
 
 try:
     from mercurial import obsolete
@@ -2115,11 +2116,7 @@  def _reachablefrombookmark(repo, revs, m
             uniquebm = False
             break
     if uniquebm:
-        rsrevs = repo.revs("ancestors(bookmark(%s)) - "
-                           "ancestors(head() and not bookmark(%s)) - "
-                           "ancestors(bookmark() and not bookmark(%s)) - "
-                           "obsolete()",
-                           mark, mark, mark)
+        rsrevs = repair.stripbmrevset(repo, mark)
         revs = set(revs)
         revs.update(set(rsrevs))
         revs = sorted(revs)