Mercurial > hgsubversion
comparison hg_delta_editor.py @ 39:b3c7b844b782
Some more fixes of cases discovered in the melange repo. If anyone knows how I can reproduce a "replaced" state in Subversion, I'd love to be able to make a real test case for this code.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sun, 26 Oct 2008 22:06:13 -0500 |
parents | 9ee7ce0505eb |
children | 496c0354019c |
comparison
equal
deleted
inserted
replaced
38:9ee7ce0505eb | 39:b3c7b844b782 |
---|---|
466 if br_path not in ctx: | 466 if br_path not in ctx: |
467 br_path2 = '' | 467 br_path2 = '' |
468 if br_path != '': | 468 if br_path != '': |
469 br_path2 = br_path + '/' | 469 br_path2 = br_path + '/' |
470 # assuming it is a directory | 470 # assuming it is a directory |
471 for f in ctx: | 471 def delete_x(x): |
472 if f.startswith(br_path2): | 472 self.deleted_files[x] = True |
473 f_p = '%s/%s' % (path, f[len(br_path2):]) | 473 map(delete_x, [pat for pat in self.current_files.iterkeys() |
474 if pat.startswith(path)]) | |
475 for f in ctx.walk(our_util.PrefixMatch(br_path2)): | |
476 f_p = '%s/%s' % (path, f[len(br_path2):]) | |
477 if f_p not in self.current_files: | |
474 self.deleted_files[f_p] = True | 478 self.deleted_files[f_p] = True |
475 self.current_files[f_p] = '' | 479 self.current_files[f_p] = '' |
476 self.ui.status('D %s\n' % f_p) | 480 self.ui.status('D %s\n' % f_p) |
477 self.deleted_files[path] = True | 481 self.deleted_files[path] = True |
478 self.current_files[path] = '' | 482 self.current_files[path] = '' |
548 fctx = cp_f_ctx.filectx(f) | 552 fctx = cp_f_ctx.filectx(f) |
549 fp_c = path + '/' + f2 | 553 fp_c = path + '/' + f2 |
550 self.current_files[fp_c] = fctx.data() | 554 self.current_files[fp_c] = fctx.data() |
551 self.current_files_exec[fp_c] = 'x' in fctx.flags() | 555 self.current_files_exec[fp_c] = 'x' in fctx.flags() |
552 self.current_files_symlink[fp_c] = 'l' in fctx.flags() | 556 self.current_files_symlink[fp_c] = 'l' in fctx.flags() |
557 if fp_c in self.deleted_files: | |
558 del self.deleted_files[fp_c] | |
553 # TODO(augie) tag copies from files | 559 # TODO(augie) tag copies from files |
554 | 560 |
555 @stash_exception_on_self | 561 @stash_exception_on_self |
556 def change_file_prop(self, file_baton, name, value, pool=None): | 562 def change_file_prop(self, file_baton, name, value, pool=None): |
557 if name == 'svn:executable': | 563 if name == 'svn:executable': |