[PATCH 3 of 5] largefiles: remove a standin check that could never be true

Na'Tosha Bard natosha at unity3d.com
Thu Jun 21 08:23:23 CDT 2012


2012/6/21 Matt Harbison <matt_harbison at yahoo.com>

> Na'Tosha Bard wrote:
>
>> 2012/6/20 Matt Harbison <matt_harbison at yahoo.com
>> <mailto:matt_harbison at yahoo.**com <matt_harbison at yahoo.com>>>
>>
>>
>>    # HG changeset patch
>>    # User Matt Harbison <matt_harbison at yahoo.com
>>    <mailto:matt_harbison at yahoo.**com <matt_harbison at yahoo.com>>>
>>
>>    # Date 1340073921 14400
>>    # Node ID f4bc770430b15cdabf07676f5ae1d6**611696aba2
>>    # Parent  0588cf50d6e8b4c06d4263418ef3b1**dcc87a2bf8
>>    largefiles: remove a standin check that could never be true
>>
>>    diff --git a/hgext/largefiles/overrides.**py
>>    b/hgext/largefiles/overrides.**py
>>    --- a/hgext/largefiles/overrides.**py
>>    +++ b/hgext/largefiles/overrides.**py
>>    @@ -818,8 +818,6 @@
>>         lfcommands.cachelfiles(ui, repo._repo, ctx.node())
>>
>>         def write(name, mode, islink, getdata):
>>    -        if lfutil.isstandin(name):
>>    -            return
>>             data = getdata()
>>
>>             archiver.addfile(prefix + repo._path + '/' + name, mode,
>>    islink, data)
>>
>>
>> Without a larger context from the diff, it is hard to tell -- why could
>> this never be true?  Simply because there is no codepath that calls
>> write() with a standin?
>>
>> Cheers,
>> Na'Tosha
>>
>>
> The calling code is basically:
>
>    for f in ctx:
>        ff = ctx.flags(f)
>        getdata = ctx[f].data
>        if lfutil.isstandin(f):
>            ...
>            f = lfutil.splitstandin(f)
>
>            def getdatafn():
>                ## read largefile content
>
>            getdata = getdatafn
>
>        write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
>
> So any standin 'f' has been replaced by the time write() is called.  I'm
> not sure what I was originally thinking, because I basically pilfered the
> code for the original patch from the override of archival.archive(), which
> doesn't do that check either.
>
> Thanks for the reviews.
>
> --Matt
>
>
OK, seems good.

N.

-- 
*Na'Tosha Bard*
Software Developer | Unity Technologies - Copenhagen

*E-Mail:* natosha at unity3d.com
*Skype:* natosha.bard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120621/0385c334/attachment.html>


More information about the Mercurial-devel mailing list