context: drop support for changeid='' (API)
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 02 Apr 2018 09:18:01 -0700
changeset 37269 de4849b67fe0
parent 37268 32857300846c
child 37270 a53b87e20132
context: drop support for changeid='' (API) Since the previous commit, there seem to be no users who pass '' to repo.__getitem__, so let's drop support for it. It may seem like a small cost to keep support for it, but I've spent time being confused by it twice already. Differential Revision: https://phab.mercurial-scm.org/D3021
mercurial/context.py
--- a/mercurial/context.py	Mon Apr 02 08:43:08 2018 -0700
+++ b/mercurial/context.py	Mon Apr 02 09:18:01 2018 -0700
@@ -411,9 +411,6 @@
         """changeid is a revision number, node, or tag"""
         super(changectx, self).__init__(repo)
 
-        if changeid == '':
-            changeid = '.'
-
         try:
             if isinstance(changeid, int):
                 self._node = repo.changelog.node(changeid)