comparison hgsubversion/editor.py @ 935:1de83496df4e

subvertpy_wrapper: fix files and directories batons handling The subvertpy wrapper was not recording and passing back the batons returned by calls such as open_file() or open_directory(). Instead, it was relying on knowledge about the HgEditor class and was passing the path argument. Its behaviour was therefore not exactly the same as the swig one because HgEditor sometimes tests the input baton and skips None ones, usually generated for ignored entries. Also, AbstractEditor was translating open_root() into open_directory(''), while the former, not implemented by HgEditor, was supplied as a default implementation by the swig bindings. The behaviour was different again. This patch was not motivated by any known bug but batons are interesting as they help control edited entries lifetime. We may use them to reduce replay mode memory consumption.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 23 Sep 2012 19:42:34 +0200
parents 63d6484c43ba
children fb6f6b7fa5a5
comparison
equal deleted inserted replaced
934:63d6484c43ba 935:1de83496df4e
300 path = self.current.batons[dir_baton] 300 path = self.current.batons[dir_baton]
301 if name == 'svn:externals': 301 if name == 'svn:externals':
302 self.current.externals[path] = value 302 self.current.externals[path] = value
303 303
304 @svnwrap.ieditor 304 @svnwrap.ieditor
305 def open_root(self, edit_baton, base_revision, dir_pool=None):
306 return None
307
308 @svnwrap.ieditor
305 def open_directory(self, path, parent_baton, base_revision, dir_pool=None): 309 def open_directory(self, path, parent_baton, base_revision, dir_pool=None):
306 self.current.batons[path] = path 310 self.current.batons[path] = path
307 p_, branch = self.meta.split_branch_path(path)[:2] 311 p_, branch = self.meta.split_branch_path(path)[:2]
308 if p_ == '' or (self.meta.layout == 'single' and p_): 312 if p_ == '' or (self.meta.layout == 'single' and p_):
309 if not self.meta.get_path_tag(path): 313 if not self.meta.get_path_tag(path):