In place extdiff

Andrei Vermel avermel at mail.ru
Sat Jun 9 08:21:59 UTC 2007


Here's what I use:

# HG changeset patch
# User Andrei Vermel <avermel at mail.ru>
# Date 1181376491 -14400
# Node ID dd7babfe369ea2a18dcea97e255616e79a8a3765
# Parent  9b9f03fd0dab96b80a114c882666aef06bf14380
Extdiff - diff single file from working dir in place

diff -r 9b9f03fd0dab -r dd7babfe369e hgext/extdiff.py
--- a/hgext/extdiff.py  Sat Jun 09 12:08:10 2007 +0400
+++ b/hgext/extdiff.py  Sat Jun 09 12:08:11 2007 +0400
@@ -117,7 +117,12 @@ def dodiff(ui, repo, diffcmd, diffopts, 
         if node2:
             dir2 = snapshot_node(modified + added, node2)
         else:
-            dir2 = snapshot_wdir(modified + added)
+            if len(modified) == 1 and len(removed) == 0 and len(added) == 0:
+                dir1 = os.path.join(dir1, util.pconvert(modified[0]))
+                dir2 = os.path.join(repo.root, util.pconvert(modified[0]))  
+            else:
+                dir2 = snapshot_wdir(modified + added)
+
         cmdline = ('%s %s %s %s' %
                    (util.shellquote(diffcmd), ' '.join(diffopts),
                     util.shellquote(dir1), util.shellquote(dir2)))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extdiff_inplace.diff
Type: application/octet-stream
Size: 1087 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20070609/f9a8da6e/attachment-0003.obj>


More information about the Mercurial mailing list