diff mercurial/manifest.py @ 27271:2a31433a59ba

manifest: use 't' for tree manifest flag We currently use 'd' to indicate that a manifest entry is a directory. Let's switch to 't', since that's not a valid hex digit and therefore easier to spot in the raw manifest data. This will break any existing repos with tree manifests, but it's still an experimental feature and there are probably only a few test repos in existence with 'd' flags.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 04 Dec 2015 14:24:45 -0800
parents 1cbf144fd8a1
children c59647c6694d
line wrap: on
line diff
--- a/mercurial/manifest.py	Sat Dec 05 23:06:03 2015 -0800
+++ b/mercurial/manifest.py	Fri Dec 04 14:24:45 2015 -0800
@@ -617,7 +617,7 @@
 
     def setflag(self, f, flags):
         """Set the flags (symlink, executable) for path f."""
-        assert 'd' not in flags
+        assert 't' not in flags
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
@@ -815,7 +815,7 @@
 
     def parse(self, text, readsubtree):
         for f, n, fl in _parse(text):
-            if fl == 'd':
+            if fl == 't':
                 f = f + '/'
                 self._dirs[f] = readsubtree(self._subpath(f), n)
             elif '/' in f:
@@ -846,7 +846,7 @@
         """
         self._load()
         flags = self.flags
-        dirs = [(d[:-1], self._dirs[d]._node, 'd') for d in self._dirs]
+        dirs = [(d[:-1], self._dirs[d]._node, 't') for d in self._dirs]
         files = [(f, self._files[f], flags(f)) for f in self._files]
         return _text(sorted(dirs + files), usemanifestv2)