D1056: context: add a fast-comparision path between arbitraryfilectx and workingfilectx

ryanmce (Ryan McElroy) phabricator at mercurial-scm.org
Mon Oct 16 06:57:49 EDT 2017


ryanmce added a comment.


  ruh-roh

INLINE COMMENTS

> context.py:2566
> +            # Add a fast-path for merge if both sides are disk-backed.
> +            # Note that filecmp uses the opposite return values as cmp.
> +            return not filecmp.cmp(self.path(), self._repo.wjoin(fctx.path()))

Ugh, haha

> context.py:2567
> +            # Note that filecmp uses the opposite return values as cmp.
> +            return not filecmp.cmp(self.path(), self._repo.wjoin(fctx.path()))
> +        return self.data() != fctx.data()

Why is this sufficient? Can't the contents be the same even if the paths are different?

I think you can only fastpath if the paths are the same, otherwise you have to fall back to data comparison.

This is already queued, but I think we need to drop it if I'm right here.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1056

To: phillco, #hg-reviewers, durin42
Cc: ryanmce, mercurial-devel


More information about the Mercurial-devel mailing list