hgext/remotenames.py
changeset 40069 fd4d59cf2ebb
parent 40068 b313f2c3b8c6
child 42603 3018749a71bb
--- a/hgext/remotenames.py	Fri Oct 05 21:39:41 2018 +0900
+++ b/hgext/remotenames.py	Fri Oct 05 21:43:57 2018 +0900
@@ -33,6 +33,7 @@
 )
 from mercurial import (
     bookmarks,
+    error,
     extensions,
     logexchange,
     namespaces,
@@ -355,6 +356,7 @@
         kind, pattern, matcher = stringutil.stringmatcher(
             revsetlang.getstring(args[0], _('argument must be a string')))
     else:
+        kind = pattern = None
         matcher = util.always
 
     nodes = set()
@@ -366,6 +368,9 @@
                 if not matcher(name):
                     continue
                 nodes.update(ns.nodes(repo, name))
+    if kind == 'literal' and not nodes:
+        raise error.RepoLookupError(_("remote name '%s' does not exist")
+                                    % pattern)
 
     revs = (cl.rev(n) for n in nodes if cl.hasnode(n))
     return subset & smartset.baseset(revs)