Patchwork D2964: context: change default changeid from old form '' to '.'

login
register
mail settings
Submitter phabricator
Date March 29, 2018, 4:46 p.m.
Message ID <differential-rev-PHID-DREV-ssgxo646sic3r7yvo5ca-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29938/
State Superseded
Headers show

Comments

phabricator - March 29, 2018, 4:46 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I don't think I've seen repo[''] in the codebase at least in the last
  two years.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - March 30, 2018, 12:16 p.m.
yuja added inline comments.

INLINE COMMENTS

> context.py:65
>              be committed."""
>      def __new__(cls, repo, changeid='', *args, **kwargs):
>          if isinstance(changeid, basectx):

Nit: one more `changeid=''` here.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers, pulkit
Cc: yuja, mercurial-devel
phabricator - March 30, 2018, 2:48 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> yuja wrote in context.py:65
> Nit: one more `changeid=''` here.

Good catch. I found this one while working on the next series, so it will get fixed then.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -415,7 +415,7 @@ 
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already present in
     the repo."""
-    def __init__(self, repo, changeid=''):
+    def __init__(self, repo, changeid='.'):
         """changeid is a revision number, node, or tag"""
 
         # since basectx.__new__ already took care of copying the object, we