# HG changeset patch # User Martin von Zweigbergk # Date 1455078153 28800 # Node ID f7c5c7847b5343baee7bc619064df11d44da75e1 # Parent 408446e4b10c4af11c39c97caa61565c3f86754e 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). diff -r 408446e4b10c -r f7c5c7847b53 mercurial/manifest.py --- 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: