mercurial/manifest.py
changeset 27271 2a31433a59ba
parent 26871 1cbf144fd8a1
child 27343 c59647c6694d
equal deleted inserted replaced
27270:ba5f20450b10 27271:2a31433a59ba
   615             cf, self._copyfunc = self._copyfunc, _noop
   615             cf, self._copyfunc = self._copyfunc, _noop
   616             cf(self)
   616             cf(self)
   617 
   617 
   618     def setflag(self, f, flags):
   618     def setflag(self, f, flags):
   619         """Set the flags (symlink, executable) for path f."""
   619         """Set the flags (symlink, executable) for path f."""
   620         assert 'd' not in flags
   620         assert 't' not in flags
   621         self._load()
   621         self._load()
   622         dir, subpath = _splittopdir(f)
   622         dir, subpath = _splittopdir(f)
   623         if dir:
   623         if dir:
   624             if dir not in self._dirs:
   624             if dir not in self._dirs:
   625                 self._dirs[dir] = treemanifest(self._subpath(dir))
   625                 self._dirs[dir] = treemanifest(self._subpath(dir))
   813     def unmodifiedsince(self, m2):
   813     def unmodifiedsince(self, m2):
   814         return not self._dirty and not m2._dirty and self._node == m2._node
   814         return not self._dirty and not m2._dirty and self._node == m2._node
   815 
   815 
   816     def parse(self, text, readsubtree):
   816     def parse(self, text, readsubtree):
   817         for f, n, fl in _parse(text):
   817         for f, n, fl in _parse(text):
   818             if fl == 'd':
   818             if fl == 't':
   819                 f = f + '/'
   819                 f = f + '/'
   820                 self._dirs[f] = readsubtree(self._subpath(f), n)
   820                 self._dirs[f] = readsubtree(self._subpath(f), n)
   821             elif '/' in f:
   821             elif '/' in f:
   822                 # This is a flat manifest, so use __setitem__ and setflag rather
   822                 # This is a flat manifest, so use __setitem__ and setflag rather
   823                 # than assigning directly to _files and _flags, so we can
   823                 # than assigning directly to _files and _flags, so we can
   844         """Get the full data of this directory as a bytestring. Make sure that
   844         """Get the full data of this directory as a bytestring. Make sure that
   845         any submanifests have been written first, so their nodeids are correct.
   845         any submanifests have been written first, so their nodeids are correct.
   846         """
   846         """
   847         self._load()
   847         self._load()
   848         flags = self.flags
   848         flags = self.flags
   849         dirs = [(d[:-1], self._dirs[d]._node, 'd') for d in self._dirs]
   849         dirs = [(d[:-1], self._dirs[d]._node, 't') for d in self._dirs]
   850         files = [(f, self._files[f], flags(f)) for f in self._files]
   850         files = [(f, self._files[f], flags(f)) for f in self._files]
   851         return _text(sorted(dirs + files), usemanifestv2)
   851         return _text(sorted(dirs + files), usemanifestv2)
   852 
   852 
   853     def read(self, gettext, readsubtree):
   853     def read(self, gettext, readsubtree):
   854         def _load_for_read(s):
   854         def _load_for_read(s):