Patchwork [02,of,10] localrepo: move _phasedefault initialization up

login
register
mail settings
Submitter Jun Wu
Date Feb. 10, 2017, 1:46 a.m.
Message ID <245b1d962dcd5df48f92.1486691176@localhost.localdomain>
Download mbox | patch
Permalink /patch/18376/
State Deferred
Headers show

Comments

Jun Wu - Feb. 10, 2017, 1:46 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1486674516 28800
#      Thu Feb 09 13:08:36 2017 -0800
# Node ID 245b1d962dcd5df48f929f10f786dc53936daabf
# Parent  bdaf60a60f81431a52291ece25ad3cd60c77ac05
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 245b1d962dcd
localrepo: move _phasedefault initialization up

See the surrounding patches for why.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -273,4 +273,8 @@  class localrepository(baselocalrepositor
 
     def __init__(self, baseui, path, create=False):
+        # A list of callback to shape the phase if no data were found.
+        # Callback are in the form: func(repo, roots) --> processed root.
+        # This list it to be filled by extension during repo setup
+        self._phasedefaults = []
         super(localrepository, self).__init__(baseui, path)
         self.auditor = pathutil.pathauditor(self.root, self._checknested)
@@ -279,8 +283,4 @@  class localrepository(baselocalrepositor
         self.ui = baseui.copy()
         self.ui.copy = baseui.copy # prevent copying repo configuration
-        # A list of callback to shape the phase if no data were found.
-        # Callback are in the form: func(repo, roots) --> processed root.
-        # This list it to be filled by extension during repo setup
-        self._phasedefaults = []
         try:
             self.ui.readconfig(self.join("hgrc"), self.root)