Comments
Patch
@@ -496,7 +496,8 @@ def bookmark(repo, subset, x):
if kind == 'literal':
bmrev = repo._bookmarks.get(pattern, None)
if not bmrev:
- raise util.Abort(_("bookmark '%s' does not exist") % bm)
+ raise error.RepoLookupError(_("bookmark '%s' does not exist")
+ % bm)
bms.add(repo[bmrev].rev())
else:
matchrevs = set()
@@ -504,8 +505,8 @@ def bookmark(repo, subset, x):
if matcher(name):
matchrevs.add(bmrev)
if not matchrevs:
- raise util.Abort(_("no bookmarks exist that match '%s'")
- % pattern)
+ raise error.RepoLookupError(_("no bookmarks exist"
+ " that match '%s'") % pattern)
for bmrev in matchrevs:
bms.add(repo[bmrev].rev())
else:
@@ -1262,15 +1263,16 @@ def named(repo, subset, x):
namespaces = set()
if kind == 'literal':
if pattern not in repo.names:
- raise util.Abort(_("namespace '%s' does not exist") % ns)
+ raise error.RepoLookupError(_("namespace '%s' does not exist")
+ % ns)
namespaces.add(repo.names[pattern])
else:
for name, ns in repo.names.iteritems():
if matcher(name):
namespaces.add(ns)
if not namespaces:
- raise util.Abort(_("no namespace exists that match '%s'")
- % pattern)
+ raise error.RepoLookupError(_("no namespace exists"
+ " that match '%s'") % pattern)
names = set()
for ns in namespaces:
@@ -1816,7 +1818,8 @@ def tag(repo, subset, x):
# avoid resolving all tags
tn = repo._tagscache.tags.get(pattern, None)
if tn is None:
- raise util.Abort(_("tag '%s' does not exist") % pattern)
+ raise error.RepoLookupError(_("tag '%s' does not exist")
+ % pattern)
s = set([repo[tn].rev()])
else:
s = set([cl.rev(n) for t, n in repo.tagslist() if matcher(t)])
@@ -133,8 +133,13 @@ bookmarks revset
$ hg log -r 'bookmark(unknown)'
- abort: bookmark 'unknown' does not exist
- [255]
+ abort: bookmark 'unknown' does not exist!
+ [255]
+ $ hg log -r 'bookmark("re:unknown")'
+ abort: no bookmarks exist that match 'unknown'!
+ [255]
+ $ hg log -r 'present(bookmark("literal:unknown"))'
+ $ hg log -r 'present(bookmark("re:unknown"))'
$ hg help revsets | grep 'bookmark('
"bookmark([name])"
@@ -709,7 +709,7 @@ check that conversion to only works
we can use patterns when searching for tags
$ log 'tag("1..*")'
- abort: tag '1..*' does not exist
+ abort: tag '1..*' does not exist!
[255]
$ log 'tag("re:1..*")'
6
@@ -720,11 +720,17 @@ we can use patterns when searching for t
$ log 'tag("re:0..*")'
$ log 'tag(unknown)'
- abort: tag 'unknown' does not exist
- [255]
+ abort: tag 'unknown' does not exist!
+ [255]
+ $ log 'tag("re:unknown")'
+ $ log 'present(tag("unknown"))'
+ $ log 'present(tag("re:unknown"))'
$ log 'branch(unknown)'
abort: unknown revision 'unknown'!
[255]
+ $ log 'branch("re:unknown")'
+ $ log 'present(branch("unknown"))'
+ $ log 'present(branch("re:unknown"))'
$ log 'user(bob)'
2
@@ -772,6 +778,15 @@ we can use patterns when searching for t
3
1
+ $ log 'named("unknown")'
+ abort: namespace 'unknown' does not exist!
+ [255]
+ $ log 'named("re:unknown")'
+ abort: no namespace exists that match 'unknown'!
+ [255]
+ $ log 'present(named("unknown"))'
+ $ log 'present(named("re:unknown"))'
+
issue2437
$ log '3 and p1(5)'