Patchwork [in,crew] revset: don't abort when regex to tag() matches nothing (issue3850)

login
register
mail settings
Submitter Kevin Bullock
Date March 18, 2013, 9:25 p.m.
Message ID <9e39a717a23e5cf91593.1363641912@opendoor.mincava.umn.edu>
Download mbox | patch
Permalink /patch/1136/
State Accepted
Commit 9e39a717a23e5cf91593336b5949e01cc6958a93
Headers show

Comments

Kevin Bullock - March 18, 2013, 9:25 p.m.
# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1363640650 18000
# Node ID 9e39a717a23e5cf91593336b5949e01cc6958a93
# Parent  1ef89df2c2487d4957e6d6f8f0d96505eb58ccef
revset: don't abort when regex to tag() matches nothing (issue3850)

This makes the tag("re:...") revset consistent with branch("re:...").

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1496,8 +1496,6 @@  def tag(repo, subset, x):
             s = set([repo[tn].rev()])
         else:
             s = set([cl.rev(n) for t, n in repo.tagslist() if matcher(t)])
-            if not s:
-                raise util.Abort(_("no tags exist that match '%s'") % pattern)
     else:
         s = set([cl.rev(n) for t, n in repo.tagslist() if t != 'tip'])
     return [r for r in subset if r in s]
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -437,8 +437,6 @@  we can use patterns when searching for t
   $ log 'tag("literal:1.0")'
   6
   $ log 'tag("re:0..*")'
-  abort: no tags exist that match '0..*'
-  [255]
 
   $ log 'tag(unknown)'
   abort: tag 'unknown' does not exist