diff --git a/hgext/extdiff.py b/hgext/extdiff.py --- a/hgext/extdiff.py +++ b/hgext/extdiff.py @@ -433,7 +433,7 @@ # ctx1a) dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a) dir1a = snapshot(ui, repo, dir1a_files, ctx1a.node(), tmproot, subrepos)[0] - rev1a = b'@%d' % ctx1a.rev() + rev1a = b'' if ctx1a.rev() is None else b'@%d' % ctx1a.rev() if do3way: # file calculation criteria same as dir1a dir1b_files = mod_b | rem_b | ((mod_a | add_a) - add_b) diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t --- a/tests/test-extdiff.t +++ b/tests/test-extdiff.t @@ -73,6 +73,15 @@ diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] +Can show diff from working copy: + $ echo c >> a + $ hg falabala -r 'wdir()' -r 1 + diffing "*\\extdiff.*\\a" "a.34eed99112ab\\a" (glob) (windows !) + diffing */extdiff.*/a a.34eed99112ab/a (glob) (no-windows !) + [1] + $ hg revert a + $ rm a.orig + Specifying an empty revision should abort. $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1