Patchwork D5932: branchmap: decode a label only once

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2019, 1:54 p.m.
Message ID <f469153881fdbaeb9bbf0542ad38cf07@localhost.localdomain>
Download mbox | patch
Permalink /patch/38671/
State Not Applicable
Headers show

Comments

phabricator - Feb. 11, 2019, 1:54 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9d0d8793e847: branchmap: decode a label only once (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5932?vs=14022&id=14028

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -280,14 +280,14 @@ 
             f.write(" ".join(cachekey) + '\n')
             nodecount = 0
             for label, nodes in sorted(self.iteritems()):
+                label = encoding.fromlocal(label)
                 for node in nodes:
                     nodecount += 1
                     if node in self._closednodes:
                         state = 'c'
                     else:
                         state = 'o'
-                    f.write("%s %s %s\n" % (hex(node), state,
-                                            encoding.fromlocal(label)))
+                    f.write("%s %s %s\n" % (hex(node), state, label))
             f.close()
             repo.ui.log('branchcache',
                         'wrote %s branch cache with %d labels and %d nodes\n',