[PATCH 1 of 7] tests: fix a bug in `f` that prevented calculating sha1sum on a file

Matt Harbison mharbison72 at gmail.com
Thu Dec 21 20:39:43 UTC 2017


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1513820472 18000
#      Wed Dec 20 20:41:12 2017 -0500
# Node ID 8675cce538f01075e9ef13c521d5c9db3e59e6f3
# Parent  44fd4cfc6c0ad3107cacad10c76ed38bd74948f4
tests: fix a bug in `f` that prevented calculating sha1sum on a file

diff --git a/tests/f b/tests/f
--- a/tests/f
+++ b/tests/f
@@ -59,7 +59,7 @@
         if isfile:
             if opts.type:
                 facts.append('file')
-            if opts.hexdump or opts.dump or opts.md5:
+            if opts.hexdump or opts.dump or opts.md5 or opts.sha1:
                 content = open(f, 'rb').read()
         elif islink:
             if opts.type:
diff --git a/tests/test-tools.t b/tests/test-tools.t
--- a/tests/test-tools.t
+++ b/tests/test-tools.t
@@ -38,6 +38,9 @@
   $ f foo
   foo:
 
+  $ f --sha1 foo
+  foo: sha1=f1d2d2f924e986ac86fdf7b36c94bcdf32beec15
+
 #if symlink
   $ f foo --mode
   foo: mode=644


More information about the Mercurial-devel mailing list