# HG changeset patch # User Hannes Oldenburg # Date 2016-08-21 08:03:22 # Node ID e1a4015f5e34642e57f44e6a621935cc8c1f6af5 # Parent 2cec6eaf36103d73900d086923d8a16851717063 histedit: use samefile function from cmdutil Replace usage of inefficient samefile function in collapse with a call to cmdutil.samefile(). diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -573,18 +573,7 @@ def collapse(repo, first, last, commitop copied = copies.pathcopies(base, last) # prune files which were reverted by the updates - def samefile(f): - if f in last.manifest(): - a = last.filectx(f) - if f in base.manifest(): - b = base.filectx(f) - return (a.data() == b.data() - and a.flags() == b.flags()) - else: - return False - else: - return f not in base.manifest() - files = [f for f in files if not samefile(f)] + files = [f for f in files if not cmdutil.samefile(f, last, base)] # commit version of these files as defined by head headmf = last.manifest() def filectxfn(repo, ctx, path):