[PATCH 02 of 10 stable] largefiles: adopt verify to batched remote statlfile (issue3780)
Kevin Bullock
kbullock+mercurial at ringworld.org
Sun Jan 27 10:11:08 CST 2013
On 24 Jan 2013, at 11:17 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1359090858 -3600
> # Branch stable
> # Node ID d956326990d42e04627d0d8077380c6f69921132
> # Parent 4ac7648ee50c5a799fec5cd2c48d89b99b6dd044
> largefiles: adopt verify to batched remote statlfile (issue3780)
>
> 9e1616307c4c introduced batching of statlfile, but not all codepaths got
> converted.
>
> 'hg verify' with a remotestore could thus crash with
> TypeError: 'builtin_function_or_method' object is not iterable
>
> Also, the 'hash' variable was used without assigning to it. Don't use variable
> names that collide with Python built-in functions. Instead we use 'expecthash'
> as in localstore.
>
> diff --git a/hgext/largefiles/remotestore.py b/hgext/largefiles/remotestore.py
> --- a/hgext/largefiles/remotestore.py
> +++ b/hgext/largefiles/remotestore.py
> @@ -87,7 +87,8 @@
>
> verified.add(key)
>
> - stat = self._stat(hash)
> + expecthash = fctx.data()[0:40]
> + stat = self._stat([expecthash])[expecthash]
> if not stat:
> return False
> elif stat == 1:
> diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
> --- a/tests/test-largefiles.t
> +++ b/tests/test-largefiles.t
> @@ -1539,10 +1539,38 @@
> remote: adding manifests
> remote: adding file changes
> remote: added 1 changesets with 1 changes to 1 files
> + $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
> + $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
>
> -Clone over http, with largefiles being pulled on update, not on clone.
> +Clone over http, no largefiles pulled on clone.
>
> - $ hg clone -q http://localhost:$HGPORT2/ http-clone -U
> + $ hg clone http://localhost:$HGPORT2/ http-clone -U
> + requesting all changes
> + adding changesets
> + adding manifests
> + adding file changes
> + added 1 changesets with 1 changes to 1 files
> +
> +verify remotestore verify:
'test verify on remotestore'? Also mentioning the issue number here would be nice.
#1 and #2 look okay to me.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial-devel
mailing list