Patchwork [7,of,7] branchmap: remove extra indent

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 5, 2016, 1:59 p.m.
Message ID <70512ad6b63f2c4bfe75.1470405560@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/16119/
State Superseded
Headers show

Comments

Pierre-Yves David - Aug. 5, 2016, 1:59 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1470402076 -7200
#      Fri Aug 05 15:01:16 2016 +0200
# Node ID 70512ad6b63f2c4bfe757b69dc5e7a5f28a3404c
# Parent  32a16c54123fbedad4ea9579d6db8344753db976
# EXP-Topic vfsward
branchmap: remove extra indent

This clean up the rest of the previous changeset.

Patch

diff -r 32a16c54123f -r 70512ad6b63f mercurial/branchmap.py
--- a/mercurial/branchmap.py	Fri Aug 05 15:00:53 2016 +0200
+++ b/mercurial/branchmap.py	Fri Aug 05 15:01:16 2016 +0200
@@ -476,27 +476,23 @@  class revbranchcache(object):
             if self._rbcnamescount < len(self._names):
                 step = ' names'
                 wlock = repo.wlock(wait=False)
-                if True:
-                    if self._rbcnamescount != 0:
-                        f = repo.vfs.open(_rbcnames, 'ab')
-                        if f.tell() == self._rbcsnameslen:
-                            f.write('\0')
-                        else:
-                            f.close()
-                            repo.ui.debug("%s changed - rewriting it\n"
-                                          % _rbcnames)
-                            self._rbcnamescount = 0
-                            self._rbcrevslen = 0
-                    if self._rbcnamescount == 0:
-                        # before rewriting names, make sure references are
-                        # removed
-                        repo.vfs.unlinkpath(_rbcrevs, ignoremissing=True)
-                        f = repo.vfs.open(_rbcnames, 'wb')
-                    f.write('\0'.join(encoding.fromlocal(b)
-                                      for b in self._names[self._rbcnamescount:]
-                                      ))
-                    self._rbcsnameslen = f.tell()
-                    f.close()
+                if self._rbcnamescount != 0:
+                    f = repo.vfs.open(_rbcnames, 'ab')
+                    if f.tell() == self._rbcsnameslen:
+                        f.write('\0')
+                    else:
+                        f.close()
+                        repo.ui.debug("%s changed - rewriting it\n" % _rbcnames)
+                        self._rbcnamescount = 0
+                        self._rbcrevslen = 0
+                if self._rbcnamescount == 0:
+                    # before rewriting names, make sure references are removed
+                    repo.vfs.unlinkpath(_rbcrevs, ignoremissing=True)
+                    f = repo.vfs.open(_rbcnames, 'wb')
+                f.write('\0'.join(encoding.fromlocal(b)
+                                  for b in self._names[self._rbcnamescount:]))
+                self._rbcsnameslen = f.tell()
+                f.close()
                 self._rbcnamescount = len(self._names)
 
             start = self._rbcrevslen * _rbcrecsize
@@ -505,19 +501,17 @@  class revbranchcache(object):
                 wlock = repo.wlock(wait=False)
                 revs = min(len(repo.changelog),
                            len(self._rbcrevs) // _rbcrecsize)
-                if True:
-                    f = repo.vfs.open(_rbcrevs, 'ab')
+                f = repo.vfs.open(_rbcrevs, 'ab')
+                if f.tell() != start:
+                    repo.ui.debug("truncating %s to %s\n" % (_rbcrevs, start))
+                    f.seek(start)
                     if f.tell() != start:
-                        repo.ui.debug("truncating %s to %s\n"
-                                      % (_rbcrevs, start))
+                        start = 0
                         f.seek(start)
-                        if f.tell() != start:
-                            start = 0
-                            f.seek(start)
-                        f.truncate()
-                    end = revs * _rbcrecsize
-                    f.write(self._rbcrevs[start:end])
-                    f.close()
+                    f.truncate()
+                end = revs * _rbcrecsize
+                f.write(self._rbcrevs[start:end])
+                f.close()
                 self._rbcrevslen = revs
         except (IOError, OSError, error.Abort, error.LockHeld) as inst:
             repo.ui.debug("couldn't write revision branch cache%s: %s\n"