Mercurial > hg
comparison hgext/histedit.py @ 29820:e1a4015f5e34
histedit: use samefile function from cmdutil
Replace usage of inefficient samefile function in collapse with a call to
cmdutil.samefile().
author | Hannes Oldenburg <hannes.christian.oldenburg@gmail.com> |
---|---|
date | Sun, 21 Aug 2016 08:03:22 +0000 |
parents | 2ff243c415b4 |
children | d5883fd055c6 |
comparison
equal
deleted
inserted
replaced
29819:2cec6eaf3610 | 29820:e1a4015f5e34 |
---|---|
571 | 571 |
572 # Recompute copies (avoid recording a -> b -> a) | 572 # Recompute copies (avoid recording a -> b -> a) |
573 copied = copies.pathcopies(base, last) | 573 copied = copies.pathcopies(base, last) |
574 | 574 |
575 # prune files which were reverted by the updates | 575 # prune files which were reverted by the updates |
576 def samefile(f): | 576 files = [f for f in files if not cmdutil.samefile(f, last, base)] |
577 if f in last.manifest(): | |
578 a = last.filectx(f) | |
579 if f in base.manifest(): | |
580 b = base.filectx(f) | |
581 return (a.data() == b.data() | |
582 and a.flags() == b.flags()) | |
583 else: | |
584 return False | |
585 else: | |
586 return f not in base.manifest() | |
587 files = [f for f in files if not samefile(f)] | |
588 # commit version of these files as defined by head | 577 # commit version of these files as defined by head |
589 headmf = last.manifest() | 578 headmf = last.manifest() |
590 def filectxfn(repo, ctx, path): | 579 def filectxfn(repo, ctx, path): |
591 if path in headmf: | 580 if path in headmf: |
592 fctx = last[path] | 581 fctx = last[path] |