Patchwork [03,of,14,RFC] changctx: use new nodeorctx method in diff

login
register
mail settings
Submitter Sean Farley
Date July 9, 2013, 9:54 p.m.
Message ID <6724e421bc24d936a6ce.1373406874@laptop.local>
Download mbox | patch
Permalink /patch/1812/
State Changes Requested
Headers show

Comments

Sean Farley - July 9, 2013, 9:54 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1373323158 18000
#      Mon Jul 08 17:39:18 2013 -0500
# Node ID 6724e421bc24d936a6ce57ceb941612be4867d66
# Parent  bf0f87c072f524b8e054de72af143a0dfc2fcffb
changctx: use new nodeorctx method in diff

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -369,12 +369,12 @@ 
 
     def diff(self, ctx2=None, match=None, **opts):
         """Returns a diff generator for the given contexts and matcher"""
         if ctx2 is None:
             ctx2 = self.p1()
-        if ctx2 is not None and not isinstance(ctx2, changectx):
-            ctx2 = self._repo[ctx2]
+        if ctx2 is not None:
+            ctx2 = nodeorctx(self._repo, ctx2)
         diffopts = patch.diffopts(self._repo.ui, opts)
         return patch.diff(self._repo, ctx2.node(), self.node(),
                           match=match, opts=diffopts)
 
     @propertycache