Mercurial > hgsubversion
comparison hg_delta_editor.py @ 145:b37c401b7f92
hg_delta_editor: reset properties of deleted entries
Otherwise, in case of entry replacement the properties are incorrectly
inherited.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 15 Dec 2008 21:57:10 -0600 |
parents | 6f2d67bf3039 |
children | 4da9f20aef01 |
comparison
equal
deleted
inserted
replaced
144:19aabf67c792 | 145:b37c401b7f92 |
---|---|
197 self.current_files[path] = data | 197 self.current_files[path] = data |
198 self.current_files_exec[path] = isexec | 198 self.current_files_exec[path] = isexec |
199 self.current_files_symlink[path] = islink | 199 self.current_files_symlink[path] = islink |
200 if path in self.deleted_files: | 200 if path in self.deleted_files: |
201 del self.deleted_files[path] | 201 del self.deleted_files[path] |
202 | |
203 def delete_file(self, path): | |
204 self.deleted_files[path] = True | |
205 self.current_files[path] = '' | |
206 self.current_files_exec[path] = False | |
207 self.current_files_symlink[path] = False | |
208 self.ui.status('D %s\n' % path) | |
202 | 209 |
203 def _normalize_path(self, path): | 210 def _normalize_path(self, path): |
204 '''Normalize a path to strip of leading slashes and our subdir if we | 211 '''Normalize a path to strip of leading slashes and our subdir if we |
205 have one. | 212 have one. |
206 ''' | 213 ''' |
514 map(delete_x, [pat for pat in self.current_files.iterkeys() | 521 map(delete_x, [pat for pat in self.current_files.iterkeys() |
515 if pat.startswith(path)]) | 522 if pat.startswith(path)]) |
516 for f in ctx.walk(our_util.PrefixMatch(br_path2)): | 523 for f in ctx.walk(our_util.PrefixMatch(br_path2)): |
517 f_p = '%s/%s' % (path, f[len(br_path2):]) | 524 f_p = '%s/%s' % (path, f[len(br_path2):]) |
518 if f_p not in self.current_files: | 525 if f_p not in self.current_files: |
519 self.deleted_files[f_p] = True | 526 self.delete_file(f_p) |
520 self.current_files[f_p] = '' | 527 self.delete_file(path) |
521 self.ui.status('D %s\n' % f_p) | |
522 self.deleted_files[path] = True | |
523 self.current_files[path] = '' | |
524 self.ui.status('D %s\n' % path) | |
525 | 528 |
526 @stash_exception_on_self | 529 @stash_exception_on_self |
527 def open_file(self, path, parent_baton, base_revision, p=None): | 530 def open_file(self, path, parent_baton, base_revision, p=None): |
528 self.current_file = 'foobaz' | 531 self.current_file = 'foobaz' |
529 fpath, branch = self._path_and_branch_for_path(path) | 532 fpath, branch = self._path_and_branch_for_path(path) |