[PATCH STABLE] largefiles: adjust localstore to handle batch statlfile requests (issue3583)
Matt Harbison
matt_harbison at yahoo.com
Tue Aug 14 22:21:24 CDT 2012
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1344998305 14400
# Branch stable
# Node ID feb654291fc0a458df203a6e6ca6b138c0f6e444
# Parent 9d9d15928521488f3721859823c445356a103b06
largefiles: adjust localstore to handle batch statlfile requests (issue3583)
This fixes a traceback when pushing to a local repo which started with
9e1616307c4c.
diff --git a/hgext/largefiles/localstore.py b/hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py
+++ b/hgext/largefiles/localstore.py
@@ -33,8 +33,12 @@
lfutil.link(lfutil.storepath(self.repo, hash),
lfutil.storepath(self.remote, hash))
- def exists(self, hash):
- return lfutil.instore(self.remote, hash)
+ def exists(self, hashes):
+ retval = {}
+ for hash in hashes:
+ retval[hash] = lfutil.instore(self.remote, hash)
+ return retval
+
def _getfile(self, tmpfile, filename, hash):
if lfutil.instore(self.remote, hash):
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -1141,6 +1141,19 @@
A f1
$ cd ..
+largefiles can be pushed locally (issue3583)
+ $ hg init dest
+ $ cd r4
+ $ hg push ../dest
+ pushing to ../dest
+ searching for changes
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ $ cd ..
+
#if serve
$ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
$ cat hg.pid >> $DAEMON_PIDS
More information about the Mercurial-devel
mailing list