Patchwork D3021: context: drop support for changeid='' (API)

login
register
mail settings
Submitter phabricator
Date April 2, 2018, 5:15 p.m.
Message ID <differential-rev-PHID-DREV-uvbfk7encbufdk6voo4c-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30135/
State Superseded
Headers show

Comments

phabricator - April 2, 2018, 5:15 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -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)