Patchwork [STABLE] largefiles: fix largefiles+subrepo update (issue3752)

login
register
mail settings
Submitter Benoit Boissinot
Date Jan. 22, 2013, 7:48 a.m.
Message ID <f648a1ac2a3db36d1e68.1358840927@pouchy.lan>
Download mbox | patch
Permalink /patch/708/
State Accepted
Commit c9db897d5a43d2858de284274709c26319a9dba6
Headers show

Comments

Benoit Boissinot - Jan. 22, 2013, 7:48 a.m.
# HG changeset patch
# User Benoit Boissinot <benoit.boissinot@ens-lyon.org>
# Date 1358840881 -3600
# Branch stable
# Node ID f648a1ac2a3db36d1e6872ed87a7713892c1c4e3
# Parent  9354a8c1bdedec8e60d9b00aeba7cd2a4bd681a0
largefiles: fix largefiles+subrepo update (issue3752)

Override updaterepo() instead of individual methods that may not be called for
each subrepo. Add test.
Based on patch from Matt Harbison.

Changes the order of update-related messages (now largefiles comes before the
global status).
Mads Kiilerich - Jan. 22, 2013, 11 p.m.
On 01/22/2013 08:48 AM, Benoit Boissinot wrote:
> # HG changeset patch
> # User Benoit Boissinot <benoit.boissinot@ens-lyon.org>
> # Date 1358840881 -3600
> # Branch stable
> # Node ID f648a1ac2a3db36d1e6872ed87a7713892c1c4e3
> # Parent  9354a8c1bdedec8e60d9b00aeba7cd2a4bd681a0
> largefiles: fix largefiles+subrepo update (issue3752)
>
> Override updaterepo() instead of individual methods that may not be called for
> each subrepo. Add test.
> Based on patch from Matt Harbison.
>
> Changes the order of update-related messages (now largefiles comes before the
> global status).

This looks good as a stable patch.

A couple of details:

> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -669,20 +669,20 @@
>       finally:
>           wlock.release()
>   
> -def hgupdate(orig, repo, node):
> -    # Only call updatelfiles the standins that have changed to save time
> -    oldstandins = lfutil.getstandinsstate(repo)
> -    result = orig(repo, node)
> -    newstandins = lfutil.getstandinsstate(repo)
> -    filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
> +def hgupdaterepo(orig, repo, node, overwrite):
> +    if not overwrite:
> +        # Only call updatelfiles on the standins that have changed to save time
> +        oldstandins = lfutil.getstandinsstate(repo)
> +
> +    result = orig(repo, node, overwrite)
> +
> +    filelist = None
> +    if not overwrite:
> +        newstandins = lfutil.getstandinsstate(repo)
> +        filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
>       lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)

instead of reusing this line

>       return result
>   
> -def hgclean(orig, repo, node, show_stats=True):
> -    result = orig(repo, node, show_stats)
> -    lfcommands.updatelfiles(repo.ui, repo)

please choose merge with this one and drop the redundant printmessage.

> -    return result
> -
>   def hgmerge(orig, repo, node, force=None, remind=True):
>       # Mark the repo as being in the middle of a merge, so that
>       # updatelfiles() will know that it needs to trust the standins in
> diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
> --- a/hgext/largefiles/uisetup.py
> +++ b/hgext/largefiles/uisetup.py
> @@ -109,11 +109,7 @@
>       entry = extensions.wrapfunction(commands, 'revert',
>                                       overrides.overriderevert)
>   
> -    # clone uses hg._update instead of hg.update even though they are the
> -    # same function... so wrap both of them)
> -    extensions.wrapfunction(hg, 'update', overrides.hgupdate)
> -    extensions.wrapfunction(hg, '_update', overrides.hgupdate)
> -    extensions.wrapfunction(hg, 'clean', overrides.hgclean)
> +    extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo)
>       extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
>   
>       extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
> diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
> --- a/tests/test-issue3084.t
> +++ b/tests/test-issue3084.t
> @@ -16,9 +16,9 @@
>     $ hg commit -m "Add foo as a largefile"
>   
>     $ hg update -r 0
> -  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>     getting changed largefiles
>     0 largefiles updated, 1 removed
> +  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>   
>     $ echo "normal" > foo
>     $ hg add foo
> diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
> --- a/tests/test-largefiles-cache.t
> +++ b/tests/test-largefiles-cache.t
> @@ -45,27 +45,27 @@
>   "missing"(!) file.
>   
>     $ hg update
> +  getting changed largefiles
> +  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally
> +  0 largefiles updated, 0 removed
>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> -  getting changed largefiles
> -  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)

some globs are lost throughout the test - they are probably needed for 
handling windows paths.

/Mads
Benoit Boissinot - Jan. 22, 2013, 11:50 p.m.
Thanks, pushing with the fixes.


On Wed, Jan 23, 2013 at 12:00 AM, Mads Kiilerich <mads@kiilerich.com> wrote:

> On 01/22/2013 08:48 AM, Benoit Boissinot wrote:
>
>> # HG changeset patch
>> # User Benoit Boissinot <benoit.boissinot@ens-lyon.org**>
>> # Date 1358840881 -3600
>> # Branch stable
>> # Node ID f648a1ac2a3db36d1e6872ed87a771**3892c1c4e3
>> # Parent  9354a8c1bdedec8e60d9b00aeba7cd**2a4bd681a0
>> largefiles: fix largefiles+subrepo update (issue3752)
>>
>> Override updaterepo() instead of individual methods that may not be
>> called for
>> each subrepo. Add test.
>> Based on patch from Matt Harbison.
>>
>> Changes the order of update-related messages (now largefiles comes before
>> the
>> global status).
>>
>
> This looks good as a stable patch.
>
> A couple of details:
>
>
>  diff --git a/hgext/largefiles/overrides.**py
>> b/hgext/largefiles/overrides.**py
>> --- a/hgext/largefiles/overrides.**py
>> +++ b/hgext/largefiles/overrides.**py
>> @@ -669,20 +669,20 @@
>>       finally:
>>           wlock.release()
>>   -def hgupdate(orig, repo, node):
>> -    # Only call updatelfiles the standins that have changed to save time
>> -    oldstandins = lfutil.getstandinsstate(repo)
>> -    result = orig(repo, node)
>> -    newstandins = lfutil.getstandinsstate(repo)
>> -    filelist = lfutil.getlfilestoupdate(**oldstandins, newstandins)
>> +def hgupdaterepo(orig, repo, node, overwrite):
>> +    if not overwrite:
>> +        # Only call updatelfiles on the standins that have changed to
>> save time
>> +        oldstandins = lfutil.getstandinsstate(repo)
>> +
>> +    result = orig(repo, node, overwrite)
>> +
>> +    filelist = None
>> +    if not overwrite:
>> +        newstandins = lfutil.getstandinsstate(repo)
>> +        filelist = lfutil.getlfilestoupdate(**oldstandins, newstandins)
>>       lfcommands.updatelfiles(repo.**ui, repo, filelist=filelist,
>> printmessage=True)
>>
>
> instead of reusing this line
>
>
>        return result
>>   -def hgclean(orig, repo, node, show_stats=True):
>> -    result = orig(repo, node, show_stats)
>> -    lfcommands.updatelfiles(repo.**ui, repo)
>>
>
> please choose merge with this one and drop the redundant printmessage.
>
>
>  -    return result
>> -
>>   def hgmerge(orig, repo, node, force=None, remind=True):
>>       # Mark the repo as being in the middle of a merge, so that
>>       # updatelfiles() will know that it needs to trust the standins in
>> diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
>> --- a/hgext/largefiles/uisetup.py
>> +++ b/hgext/largefiles/uisetup.py
>> @@ -109,11 +109,7 @@
>>       entry = extensions.wrapfunction(**commands, 'revert',
>>                                       overrides.overriderevert)
>>   -    # clone uses hg._update instead of hg.update even though they are
>> the
>> -    # same function... so wrap both of them)
>> -    extensions.wrapfunction(hg, 'update', overrides.hgupdate)
>> -    extensions.wrapfunction(hg, '_update', overrides.hgupdate)
>> -    extensions.wrapfunction(hg, 'clean', overrides.hgclean)
>> +    extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo)
>>       extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
>>         extensions.wrapfunction(**archival, 'archive',
>> overrides.overridearchive)
>> diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
>> --- a/tests/test-issue3084.t
>> +++ b/tests/test-issue3084.t
>> @@ -16,9 +16,9 @@
>>     $ hg commit -m "Add foo as a largefile"
>>       $ hg update -r 0
>> -  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>>     getting changed largefiles
>>     0 largefiles updated, 1 removed
>> +  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>>       $ echo "normal" > foo
>>     $ hg add foo
>> diff --git a/tests/test-largefiles-cache.**t
>> b/tests/test-largefiles-cache.**t
>> --- a/tests/test-largefiles-cache.**t
>> +++ b/tests/test-largefiles-cache.**t
>> @@ -45,27 +45,27 @@
>>   "missing"(!) file.
>>       $ hg update
>> +  getting changed largefiles
>> +  error getting 7f7097b041ccf68cc5561e9600da46**55d21c6d18 from
>> file:$TESTTMP/mirror for large: can't get file locally
>> +  0 largefiles updated, 0 removed
>>     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> -  getting changed largefiles
>> -  error getting 7f7097b041ccf68cc5561e9600da46**55d21c6d18 from
>> file:$TESTTMP/mirror for large: can't get file locally (glob)
>>
>
> some globs are lost throughout the test - they are probably needed for
> handling windows paths.
>
> /Mads
>
>

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -669,20 +669,20 @@ 
     finally:
         wlock.release()
 
-def hgupdate(orig, repo, node):
-    # Only call updatelfiles the standins that have changed to save time
-    oldstandins = lfutil.getstandinsstate(repo)
-    result = orig(repo, node)
-    newstandins = lfutil.getstandinsstate(repo)
-    filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
+def hgupdaterepo(orig, repo, node, overwrite):
+    if not overwrite:
+        # Only call updatelfiles on the standins that have changed to save time
+        oldstandins = lfutil.getstandinsstate(repo)
+
+    result = orig(repo, node, overwrite)
+
+    filelist = None
+    if not overwrite:
+        newstandins = lfutil.getstandinsstate(repo)
+        filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
     lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
     return result
 
-def hgclean(orig, repo, node, show_stats=True):
-    result = orig(repo, node, show_stats)
-    lfcommands.updatelfiles(repo.ui, repo)
-    return result
-
 def hgmerge(orig, repo, node, force=None, remind=True):
     # Mark the repo as being in the middle of a merge, so that
     # updatelfiles() will know that it needs to trust the standins in
diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py
+++ b/hgext/largefiles/uisetup.py
@@ -109,11 +109,7 @@ 
     entry = extensions.wrapfunction(commands, 'revert',
                                     overrides.overriderevert)
 
-    # clone uses hg._update instead of hg.update even though they are the
-    # same function... so wrap both of them)
-    extensions.wrapfunction(hg, 'update', overrides.hgupdate)
-    extensions.wrapfunction(hg, '_update', overrides.hgupdate)
-    extensions.wrapfunction(hg, 'clean', overrides.hgclean)
+    extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo)
     extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
 
     extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -16,9 +16,9 @@ 
   $ hg commit -m "Add foo as a largefile"
 
   $ hg update -r 0
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 1 removed
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
   $ echo "normal" > foo
   $ hg add foo
diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t
+++ b/tests/test-largefiles-cache.t
@@ -45,27 +45,27 @@ 
 "missing"(!) file.
 
   $ hg update
+  getting changed largefiles
+  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally
+  0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  getting changed largefiles
-  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
-  0 largefiles updated, 0 removed
   $ hg status
   ! large
 
 Update working directory to null: this cleanup .hg/largefiles/dirstate
 
   $ hg update null
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
 Update working directory to tip, again.
 
   $ hg update
+  getting changed largefiles
+  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally
+  0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  getting changed largefiles
-  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
-  0 largefiles updated, 0 removed
   $ hg status
   ! large
   $ cd ..
diff --git a/tests/test-largefiles-small-disk.t b/tests/test-largefiles-small-disk.t
--- a/tests/test-largefiles-small-disk.t
+++ b/tests/test-largefiles-small-disk.t
@@ -57,7 +57,6 @@ 
   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
   abort: No space left on device
   [255]
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -506,9 +506,9 @@ 
 Test addremove with -R
 
   $ hg up -C
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm normal3
   $ rm sub/large4
   $ echo "testing addremove with patterns" > testaddremove.dat
@@ -524,9 +524,9 @@ 
 Test 3364
   $ hg clone . ../addrm
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../addrm
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
@@ -604,9 +604,9 @@ 
   C sub2/large6
   C sub2/large7
   $ hg up -C '.^'
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg remove large
   $ hg addremove --traceback
   $ hg ci -m "removed large"
@@ -715,9 +715,9 @@ 
 
   $ hg clone . ../b
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../b
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   7:daea875e9014  add/edit more largefiles
@@ -745,9 +745,9 @@ 
   adding file changes
   added 4 changesets with 10 changes to 4 files
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd c
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   3:9e8fbc4bce62  copy files
@@ -767,9 +767,9 @@ 
 tests update).
 
   $ hg update -r 1
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat large1
   large11
   $ cat sub/large2
@@ -781,17 +781,17 @@ 
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles a a-backup
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   8 additional largefiles cached
 
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 0 a a-clone0
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   9 additional largefiles cached
   $ hg -R a-clone0 sum
   parent: 0:30d30fe6a5be 
@@ -803,9 +803,9 @@ 
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 1 a a-clone1
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   8 additional largefiles cached
   $ hg -R a-clone1 sum
   parent: 1:ce8896473775 
@@ -828,9 +828,9 @@ 
   $ hg clone ../a
   destination directory: a
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
 
 Ensure base clone command argument validation
@@ -854,9 +854,9 @@ 
   adding file changes
   added 2 changesets with 8 changes to 4 files
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm "${USERCACHE}"/*
   $ cd a-backup
   $ hg pull --all-largefiles --config paths.default-push=bogus/path
@@ -877,9 +877,9 @@ 
 
   $ hg clone a d
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd b
   $ echo large4-modified > sub/large4
   $ echo normal3-modified > normal3
@@ -897,9 +897,9 @@ 
   $ cd ..
   $ hg clone d e
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd d
 
 More rebase testing, but also test that the largefiles are downloaded from
@@ -1065,9 +1065,9 @@ 
   $ hg revert sub2/large7
   $ hg -q update --clean -r null
   $ hg update --clean
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat normal3
   normal3-modified
   $ cat sub/normal4
@@ -1086,22 +1086,22 @@ 
 demonstrate misfeature: .orig file is overwritten on every update -C,
 also when clean:
   $ hg update --clean
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat sub2/large7.orig
   large7
   $ rm sub2/large7.orig .hglf/sub2/large7.orig
 
 Now "update check" is happy.
   $ hg update --check 8
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg update --check
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test removing empty largefiles directories on update
   $ test -d sub2 && echo "sub2 exists"
@@ -1190,14 +1190,14 @@ 
   adding file changes
   added 8 changesets with 24 changes to 10 files
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg clone temp f
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
 # Delete the largefiles in the largefiles system cache so that we have an
 # opportunity to test that caching after a pull works.
   $ rm "${USERCACHE}"/*
@@ -1289,9 +1289,9 @@ 
   adding file changes
   added 9 changesets with 26 changes to 10 files
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd g
   $ hg transplant -s ../d 598410d3eb9a
   searching for changes
@@ -1551,7 +1551,6 @@ 
    .hglf/f1: remote created -> g
   updating: .hglf/f1 1/1 files (100.00%)
   getting .hglf/f1
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   using http://localhost:$HGPORT2/
   sending capabilities command
@@ -1561,6 +1560,7 @@ 
   sending getlfile command
   found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
   1 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ ls http-clone-usercache/*
   http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
@@ -1601,9 +1601,9 @@ 
   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
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
   $ chmod -R u+w alice/pubrepo
   $ HOME="$ORIGHOME"
@@ -1755,23 +1755,48 @@ 
   A normal.txt
   Invoking status precommit hook
   M .hgsubstate
-  $ hg archive -S lf_subrepo_archive
-  $ find lf_subrepo_archive | sort
-  lf_subrepo_archive
-  lf_subrepo_archive/.hg_archival.txt
-  lf_subrepo_archive/.hgsub
-  lf_subrepo_archive/.hgsubstate
-  lf_subrepo_archive/a
-  lf_subrepo_archive/a/b
-  lf_subrepo_archive/a/b/c
-  lf_subrepo_archive/a/b/c/d
-  lf_subrepo_archive/a/b/c/d/e.large.txt
-  lf_subrepo_archive/a/b/c/d/e.normal.txt
-  lf_subrepo_archive/a/b/c/x
-  lf_subrepo_archive/a/b/c/x/y.normal.txt
-  lf_subrepo_archive/subrepo
-  lf_subrepo_archive/subrepo/large.txt
-  lf_subrepo_archive/subrepo/normal.txt
+  $ hg archive -S ../lf_subrepo_archive
+  $ find ../lf_subrepo_archive | sort
+  ../lf_subrepo_archive
+  ../lf_subrepo_archive/.hg_archival.txt
+  ../lf_subrepo_archive/.hgsub
+  ../lf_subrepo_archive/.hgsubstate
+  ../lf_subrepo_archive/a
+  ../lf_subrepo_archive/a/b
+  ../lf_subrepo_archive/a/b/c
+  ../lf_subrepo_archive/a/b/c/d
+  ../lf_subrepo_archive/a/b/c/d/e.large.txt
+  ../lf_subrepo_archive/a/b/c/d/e.normal.txt
+  ../lf_subrepo_archive/a/b/c/x
+  ../lf_subrepo_archive/a/b/c/x/y.normal.txt
+  ../lf_subrepo_archive/subrepo
+  ../lf_subrepo_archive/subrepo/large.txt
+  ../lf_subrepo_archive/subrepo/normal.txt
+
+Test update with subrepos.
+
+  $ hg update 0
+  getting changed largefiles
+  0 largefiles updated, 1 removed
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg status -S
+  $ hg update tip
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status -S
+# modify a large file
+  $ echo "modified" > subrepo/large.txt
+  $ hg st -S
+  M subrepo/large.txt
+# update -C should revert the change.
+  $ hg update -C
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status -S
 
 Test archiving a revision that references a subrepo that is not yet
 cloned (see test-subrepo-recursion.t):
diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t
--- a/tests/test-lfconvert.t
+++ b/tests/test-lfconvert.t
@@ -78,9 +78,9 @@ 
 "lfconvert" converts content correctly
   $ cd largefiles-repo
   $ hg up
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg locate
   .hglf/large
   .hglf/sub/maybelarge.dat
@@ -187,9 +187,9 @@ 
   normal1
   stuff/normal2
   $ hg update
-  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat stuff/normal2
   alsonormal
   blah