Patchwork D1896: obsolete: use native string when peeking in __dict__

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 1:39 p.m.
Message ID <differential-rev-PHID-DREV-qynu76zsl3zwstk2cqeq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26883/
State Superseded
Headers show

Comments

phabricator - Jan. 18, 2018, 1:39 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Jan. 19, 2018, 6:22 a.m.
pulkit added a comment.


  The commit description says "skip blame just a bytes prefix", I think that's not correct.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Feb. 1, 2018, 8:37 p.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Using raw strings away from the consumer is a bit weird. But this is a minor nit.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, pulkit, indygreg
Cc: indygreg, pulkit, mercurial-devel

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -570,7 +570,7 @@ 
         return len(self._all)
 
     def __nonzero__(self):
-        if not self._cached('_all'):
+        if not self._cached(r'_all'):
             try:
                 return self.svfs.stat('obsstore').st_size > 1
             except OSError as inst:
@@ -727,11 +727,11 @@ 
         markers = list(markers) # to allow repeated iteration
         self._data = self._data + rawdata
         self._all.extend(markers)
-        if self._cached('successors'):
+        if self._cached(r'successors'):
             _addsuccessors(self.successors, markers)
-        if self._cached('predecessors'):
+        if self._cached(r'predecessors'):
             _addpredecessors(self.predecessors, markers)
-        if self._cached('children'):
+        if self._cached(r'children'):
             _addchildren(self.children, markers)
         _checkinvalidmarkers(markers)