diff mercurial/manifest.py @ 28215:f7c5c7847b53

treemanifest: allow setting flag to 't' When using treemanifests, an on-disk manifest entry with the 't' flag set means that that entry is a directory and not a file. When read into memory, these become instances of the treemanifest class. The 't' flag should therefore never be visible to outside of manifest.py, so setflag() checks that it is not called with the 't' flag. However, it turns out that it will be useful for the narrowhg extension to expose the 't' flag to the user (see below), so let's drop the assertion. The narrowhg extension allows cloning only a given set of files and directories. Filelogs and dirlogs that don't match that set will not be included in the clone. The extension currently doesn't work with treemanifests. I plan on changing it so directories outside the narrow clone appear in the manifest. For example, if a directory 'outside/' is not part of the narrow clone, it will look like a file 'outside' with the 't' flag set. That will make e.g. manifestmerge() just work in most cases (and make it well prepared to handle the other cases).
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 09 Feb 2016 20:22:33 -0800
parents 43edd3003456
children 1ac8ce137377
line wrap: on
line diff
--- a/mercurial/manifest.py	Tue Feb 23 17:22:51 2016 -0800
+++ b/mercurial/manifest.py	Tue Feb 09 20:22:33 2016 -0800
@@ -639,7 +639,6 @@
 
     def setflag(self, f, flags):
         """Set the flags (symlink, executable) for path f."""
-        assert 't' not in flags
         self._load()
         dir, subpath = _splittopdir(f)
         if dir: