Patchwork D3196: revsymbol: stop delegating to repo.__getitem__ for unhandled symbols (API)

login
register
mail settings
Submitter phabricator
Date April 11, 2018, 12:32 p.m.
Message ID <4ebf9b5a407d5cca1a23aa8610ab0859@localhost.localdomain>
Download mbox | patch
Permalink /patch/30693/
State Not Applicable
Headers show

Comments

phabricator - April 11, 2018, 12:32 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6639ac97ec3b: revsymbol: stop delegating to repo.__getitem__ for unhandled symbols (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3196?vs=7888&id=7977

REVISION DETAIL
  https://phab.mercurial-scm.org/D3196

AFFECTED FILES
  mercurial/scmutil.py
  tests/test-pull.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-pull.t b/tests/test-pull.t
--- a/tests/test-pull.t
+++ b/tests/test-pull.t
@@ -72,7 +72,7 @@ 
   [255]
   $ hg pull -r 'xxxxxxxxxxxxxxxxxx y'
   pulling from http://foo@localhost:$HGPORT/
-  abort: unknown revision '7878787878787878787878787878787878782079'!
+  abort: unknown revision 'xxxxxxxxxxxxxxxxxx y'!
   [255]
 
 Issue622: hg init && hg pull -u URL doesn't checkout default branch
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -503,7 +503,7 @@ 
             rev = repo.changelog.rev(node)
             return repo[rev]
 
-        return repo[symbol]
+        raise error.RepoLookupError(_("unknown revision '%s'") % symbol)
 
     except error.WdirUnsupported:
         return repo[None]