Patchwork D6339: repair: reword comments that I noticed while working on source formatting

login
register
mail settings
Submitter phabricator
Date May 4, 2019, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-ifwods5e5ssmd5jzx3kd-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39945/
State Superseded
Headers show

Comments

phabricator - May 4, 2019, 2:37 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I think this is clearer, and one will also keep us from upsetting
  check-code when other formatting cleanups happen.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - May 4, 2019, 4:03 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> repair.py:421
> +        if 'treemanifest' in repo.requirements:
> +            # otherwise This logic is safe if treemanifest isn't in
> +            # use, but it's also not required so we skip it if it's

Nit: use same message as above

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: martinvonz, mercurial-devel
phabricator - May 5, 2019, 3:03 a.m.
durin42 added a comment.


  PTAL

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -364,8 +364,9 @@ 
     striptrees(repo, tr, striprev, files)
 
 def striptrees(repo, tr, striprev, files):
-    if 'treemanifest' in repo.requirements: # safe but unnecessary
-                                            # otherwise
+    if 'treemanifest' in repo.requirements:
+        # This logic is safe if treemanifest isn't enabled, but also
+        # pointless, so we skip it if treemanifest isn't enabled.
         for unencoded, encoded, size in repo.store.datafiles():
             if (unencoded.startswith('meta/') and
                 unencoded.endswith('00manifest.i')):
@@ -416,7 +417,10 @@ 
 
         progress.complete()
 
-        if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise
+        if 'treemanifest' in repo.requirements:
+            # otherwise This logic is safe if treemanifest isn't in
+            # use, but it's also not required so we skip it if it's
+            # not needed.
             for dir in util.dirs(seenfiles):
                 i = 'meta/%s/00manifest.i' % dir
                 d = 'meta/%s/00manifest.d' % dir