[PATCH 1 of 3 STABLE] context: reimplement memfilectx.cmp()
Yuya Nishihara
yuya at tcha.org
Sun Dec 16 08:24:20 UTC 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1544947726 -32400
# Sun Dec 16 17:08:46 2018 +0900
# Node ID 79dc95eb84b0f09a39fb396c65ec591f9f0de224
# Parent f1a69099327b6c3d92d2541fe8d40f8fe37a546e
context: reimplement memfilectx.cmp()
If I added a sanity check to basefilectx, test-context.py exploded. This
patch copies the naive implementation from overlayworkingfilectx.
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2330,6 +2330,9 @@ class memfilectx(committablefilectx):
if copied:
self._copied = (copied, nullid)
+ def cmp(self, fctx):
+ return self.data() != fctx.data()
+
def data(self):
return self._data
More information about the Mercurial-devel
mailing list