Patchwork [2,of,2] phases: initialize number of loaded revisions to 0

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 14, 2017, 1:49 p.m.
Message ID <a1744bbbec20259e7d2f.1513259390@mimosa>
Download mbox | patch
Permalink /patch/26280/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 14, 2017, 1:49 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1513258630 -32400
#      Thu Dec 14 22:37:10 2017 +0900
# Node ID a1744bbbec20259e7d2fed8733fd07031abbeb43
# Parent  54f71d88d66d59e557a7224d5d96164bded3292d
phases: initialize number of loaded revisions to 0

As it isn't a revision number, an empty value should be 0, not -1.
Augie Fackler - Dec. 15, 2017, 11:20 p.m.
On Thu, Dec 14, 2017 at 10:49:50PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1513258630 -32400
> #      Thu Dec 14 22:37:10 2017 +0900
> # Node ID a1744bbbec20259e7d2fed8733fd07031abbeb43
> # Parent  54f71d88d66d59e557a7224d5d96164bded3292d
> phases: initialize number of loaded revisions to 0

queued, thanks

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -203,7 +203,7 @@  class phasecache(object):
         if _load:
             # Cheap trick to allow shallow-copy without copy module
             self.phaseroots, self.dirty = _readroots(repo, phasedefaults)
-            self._loadedrevslen = nullrev
+            self._loadedrevslen = 0
             self._phasesets = None
             self.filterunknown(repo)
             self.opener = repo.svfs
@@ -294,7 +294,7 @@  class phasecache(object):
                 self._computephaserevspure(repo)
 
     def invalidate(self):
-        self._loadedrevslen = nullrev
+        self._loadedrevslen = 0
         self._phasesets = None
 
     def phase(self, repo, rev):