Patchwork D1977: narrow: this code should assume REVIDX_FLAGS_ORDER exists

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 11 p.m.
Message ID <differential-rev-PHID-DREV-elwycarkjdu6dq4aq6lg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27166/
State Superseded
Headers show

Comments

phabricator - Feb. 1, 2018, 11 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/D1977

AFFECTED FILES
  hgext/narrow/narrowrevlog.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 2, 2018, 6:41 p.m.
martinvonz requested changes to this revision.
martinvonz added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> narrowrevlog.py:16-20
>  ELLIPSIS_NODE_FLAG = 1 << 14
>  revlog.REVIDX_KNOWN_FLAGS |= ELLIPSIS_NODE_FLAG
> -if (util.safehasattr(revlog, 'REVIDX_FLAGS_ORDER') and
> -    ELLIPSIS_NODE_FLAG not in revlog.REVIDX_FLAGS_ORDER):
> -        revlog.REVIDX_FLAGS_ORDER.append(ELLIPSIS_NODE_FLAG)

looks like you can instead drop all of this since we have now (since https://phab.mercurial-scm.org/rHG08b34c3a6f74800b5b357f371568177827963e2b) defined the flag in revlog.py  (and just use revlog.REVIDX_ELLIPSIS instead below)

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Feb. 12, 2018, 8:21 p.m.
durin42 added inline comments.

INLINE COMMENTS

> martinvonz wrote in narrowrevlog.py:16-20
> looks like you can instead drop all of this since we have now (since https://phab.mercurial-scm.org/rHG08b34c3a6f74800b5b357f371568177827963e2b) defined the flag in revlog.py  (and just use revlog.REVIDX_ELLIPSIS instead below)

I'll do that in https://phab.mercurial-scm.org/D2008.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -15,9 +15,8 @@ 
 
 ELLIPSIS_NODE_FLAG = 1 << 14
 revlog.REVIDX_KNOWN_FLAGS |= ELLIPSIS_NODE_FLAG
-if (util.safehasattr(revlog, 'REVIDX_FLAGS_ORDER') and
-    ELLIPSIS_NODE_FLAG not in revlog.REVIDX_FLAGS_ORDER):
-        revlog.REVIDX_FLAGS_ORDER.append(ELLIPSIS_NODE_FLAG)
+if ELLIPSIS_NODE_FLAG not in revlog.REVIDX_FLAGS_ORDER:
+    revlog.REVIDX_FLAGS_ORDER.append(ELLIPSIS_NODE_FLAG)
 
 def readtransform(self, text):
     return text, False