changeset 3387:2065789f6a3e

use short hashes with diff -v
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 13 Oct 2006 15:34:35 -0300
parents 55476ce8e59c
children 5eecae4ff722
files mercurial/patch.py tests/test-diff-hashes tests/test-diff-hashes.out
diffstat 3 files changed, 58 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Oct 13 11:17:17 2006 -0700
+++ b/mercurial/patch.py	Fri Oct 13 15:34:35 2006 -0300
@@ -526,7 +526,7 @@
     if repo.ui.quiet:
         r = None
     else:
-        hexfunc = repo.ui.verbose and hex or short
+        hexfunc = repo.ui.debugflag and hex or short
         r = [hexfunc(node) for node in [node1, node2] if node]
 
     if opts.git:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-hashes	Fri Oct 13 15:34:35 2006 -0300
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+hg init a
+cd a
+echo bar > foo
+hg add foo
+hg ci -m 'add foo' -d '1000000 0'
+
+echo foobar > foo
+hg ci -m 'change foo' -d '1000001 0'
+
+echo 'quiet:'
+hg --quiet diff -r 0 -r 1
+echo
+
+echo 'normal:'
+hg diff -r 0 -r 1
+echo
+
+echo 'verbose:'
+hg --verbose diff -r 0 -r 1
+echo
+
+echo 'debug:'
+hg --debug diff -r 0 -r 1
+echo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-hashes.out	Fri Oct 13 15:34:35 2006 -0300
@@ -0,0 +1,31 @@
+quiet:
+--- a/foo	Mon Jan 12 13:46:40 1970 +0000
++++ b/foo	Mon Jan 12 13:46:41 1970 +0000
+@@ -1,1 +1,1 @@ bar
+-bar
++foobar
+
+normal:
+diff -r 74de3f1392e2 -r b8b5f023a6ad foo
+--- a/foo	Mon Jan 12 13:46:40 1970 +0000
++++ b/foo	Mon Jan 12 13:46:41 1970 +0000
+@@ -1,1 +1,1 @@ bar
+-bar
++foobar
+
+verbose:
+diff -r 74de3f1392e2 -r b8b5f023a6ad foo
+--- a/foo	Mon Jan 12 13:46:40 1970 +0000
++++ b/foo	Mon Jan 12 13:46:41 1970 +0000
+@@ -1,1 +1,1 @@ bar
+-bar
++foobar
+
+debug:
+diff -r 74de3f1392e2d67856fb155963441f2610494e1a -r b8b5f023a6ad77fc378bd95cf3fa00cd1414d107 foo
+--- a/foo	Mon Jan 12 13:46:40 1970 +0000
++++ b/foo	Mon Jan 12 13:46:41 1970 +0000
+@@ -1,1 +1,1 @@ bar
+-bar
++foobar
+