Patchwork D3019: subrepo: use repo['.'] instead of repo['']

login
register
mail settings
Submitter phabricator
Date April 2, 2018, 5:15 p.m.
Message ID <differential-rev-PHID-DREV-oztv23upbt6f4yosdwww-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30133/
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
  The "state" value (a revision) passed to abstractsubrepo.phase() can
  be '' to represent the currently checked out revisions. Let's convert
  that to the more common '.'.
  
  I think this is the last of use of repo['.'] in core.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/subrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -603,7 +603,7 @@ 
 
     @annotatesubrepoerror
     def phase(self, state):
-        return self._repo[state].phase()
+        return self._repo[state or '.'].phase()
 
     @annotatesubrepoerror
     def remove(self):