[PATCH 1 of 2] store: move _plainhybridencode and _dothybridencode higher up in the file

Adrian Buehlmann adrian at cadifra.com
Wed Sep 19 07:15:43 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1348055931 -7200
# Node ID 28fbfcdd9c9384a4ea24c28c88636ed0633615ae
# Parent  558e5d6ca341e692ea0641e202515a4aaca8eb6a
store: move _plainhybridencode and _dothybridencode higher up in the file

no functional change

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -254,6 +254,20 @@
         res = _hashencode(path, dotencode)
     return res
 
+def _plainhybridencode(f):
+    return _hybridencode(f, False)
+
+_pathencode = getattr(parsers, 'pathencode', None)
+if _pathencode:
+    def _dothybridencode(f):
+        ef = _pathencode(f)
+        if ef is None:
+            return _hashencode(encodedir(f), True)
+        return ef
+else:
+    def _dothybridencode(f):
+        return _hybridencode(f, True)
+
 def _calcmode(path):
     try:
         # files in .hg/ will be created using this mode
@@ -419,20 +433,6 @@
             self.fncache.add(path)
         return self.opener(self.encode(path), mode, *args, **kw)
 
-def _plainhybridencode(f):
-    return _hybridencode(f, False)
-
-_pathencode = getattr(parsers, 'pathencode', None)
-if _pathencode:
-    def _dothybridencode(f):
-        ef = _pathencode(f)
-        if ef is None:
-            return _hashencode(encodedir(f), True)
-        return ef
-else:
-    def _dothybridencode(f):
-        return _hybridencode(f, True)
-
 class fncachestore(basicstore):
     def __init__(self, path, openertype, dotencode):
         if dotencode:


More information about the Mercurial-devel mailing list