[PATCH 2 of 2] subrepo: return only the manifest keys from hgsubrepo.files()

Matt Harbison mharbison72 at gmail.com
Sat Feb 28 00:34:42 CST 2015


On Sat, 28 Feb 2015 00:58:20 -0500, Martin von Zweigbergk  
<martinvonz at google.com> wrote:

> This series LGTM.
>
> I could only find one subrepo class that returns paths, namely the
> svnsubrepo (the gitsubrepo seems not to be implemented). But the new  
> return
> value is also in line with the docstring, which says "return filename
> iterator".

Yep.  I definitely elided 'docstring says' with 'svn implementation does'.

Thanks for the quick review.


> On Fri, Feb 27, 2015 at 9:49 PM Matt Harbison <mharbison72 at gmail.com>  
> wrote:
>
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison at yahoo.com>
>> # Date 1424039350 18000
>> #      Sun Feb 15 17:29:10 2015 -0500
>> # Node ID 31179e583de4692c966819b4fea6f14286921b67
>> # Parent  d36fb8953555e4e0c7849b1f9e7b61a31e790c28
>> subrepo: return only the manifest keys from hgsubrepo.files()
>>
>> This is in line with the other subrepo classes (i.e. only the filenames  
>> are
>> returned).  Archive iterates over the manifest keys, and since subrepo
>> archive()
>> uses this method, it does too now.  This will allow largefiles to  
>> override
>> its
>> manifest keys to present the largefiles instead of the standins.  Once  
>> in
>> place,
>> we shouldn't need the copy/paste overrides of archive and subrepo  
>> archive
>> in
>> largefiles, that don't quite behave like the core methods they are
>> overriding.
>>
>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>> --- a/mercurial/subrepo.py
>> +++ b/mercurial/subrepo.py
>> @@ -836,7 +836,7 @@
>>      def files(self):
>>          rev = self._state[1]
>>          ctx = self._repo[rev]
>> -        return ctx.manifest()
>> +        return ctx.manifest().keys()
>>
>>      def filedata(self, name):
>>          rev = self._state[1]
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list