[PATCH] largefiles: fix argument to util.sha

Carter, Eli Eli.Carter at tektronix.com
Mon Oct 31 15:08:03 CDT 2011


> -----Original Message-----
> From: Matt Mackall [mailto:mpm at selenic.com]
> Sent: Monday, October 31, 2011 2:32 PM
> To: Carter, Eli
> Cc: mercurial-devel at selenic.com
> Subject: RE: [PATCH] largefiles: fix argument to util.sha
> 
> On Mon, 2011-10-31 at 12:13 -0700, Carter, Eli wrote:
> > The call isn't to sha(), it's to util.sha1().  The def of sha1() in util.py requires
> an argument.
> >
> > An alternative fix would be:
> > def sha1(s=''):
> > in mercurial/util.py.
> > I figured fixing the caller was a smaller change.
> 
> It is a smaller change, however fixing it in util is still nearly trivial and means
> we don't need to document the issue, debug any future offenders, etc.

Here's a testcase that verifies the fix:


# HG changeset patch
# User Eli Carter <eli.carter at tektronix.com>
# Date 1320091358 18000
# Branch largefiles-ssh-testcase
# Node ID ab1af8bffd4ee66c61c2119f8e9a2bfc1e730d00
# Parent  87248de091352f746e8cd1cee01af29138c8e443
largefiles: testcase to demonstrate ssh bug

diff -r 87248de09135 -r ab1af8bffd4e tests/test-largefiles.t
--- a/tests/test-largefiles.t	Sun Oct 30 12:10:11 2011 -0500
+++ b/tests/test-largefiles.t	Mon Oct 31 15:02:38 2011 -0500
@@ -816,6 +816,23 @@
   getting changed largefiles
   1 largefiles updated, 0 removed
   $ cd ..
+
+Clone a repo over ssh that has a file the local user does not have in the user cache
+  $ ALICEHOME=`pwd`/alice
+  $ mkdir charlie
+  $ HOME="`pwd`/charlie"
+  $ cd charlie
+  $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/$ALICEHOME/pubrepo localrepo
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cd ..
   $ HOME="$ORIGHOME"
 
 Symlink to a large largefile should behave the same as a symlink to a normal file





More information about the Mercurial-devel mailing list