[PATCH] largefiles: correctly catch exception on localized systems (issue3196)

Na'Tosha Bard natosha at unity3d.com
Thu Jan 12 07:35:27 CST 2012


2012/1/12 Mads Kiilerich <mads at kiilerich.com>

> On 01/12/2012 02:13 PM, Na'Tosha Bard wrote:
>
>> # HG changeset patch
>> # User Na'Tosha Bard<natosha at unity3d.com>
>> # Date 1326373926 -3600
>> # Node ID 88edae221c023d2073f4e2d45b120f**76766c73ef
>> # Parent  c47d69ce5208d5b5cfd2fb2f0f1d7a**2b4795fbf5
>> largefiles: correctly catch exception on localized systems (issue3196)
>>
>> diff -r c47d69ce5208 -r 88edae221c02 hgext/largefiles/overrides.py
>> --- a/hgext/largefiles/overrides.**py     Wed Jan 11 09:27:53 2012 -0600
>> +++ b/hgext/largefiles/overrides.**py     Thu Jan 12 14:12:06 2012 +0100
>> @@ -413,7 +413,7 @@
>>              installnormalfilesmatchfn(**repo[None].manifest())
>>              result = orig(ui, repo, pats, opts, rename)
>>          except util.Abort, e:
>> -            if str(e) != 'no files to copy':
>> +            if str(e) != _('no files to copy'):
>>                  raise e
>>              else:
>>                  nonormalfiles = True
>> @@ -500,7 +500,7 @@
>>                      lfdirstate.add(destlfile)
>>              lfdirstate.write()
>>          except util.Abort, e:
>> -            if str(e) != 'no files to copy':
>> +            if str(e) != _('no files to copy'):
>>
>
> I agree that this needs to fixed - it is the most ugly spot in the whole
> Mercurial code base. But papering it over like this is at most an temporary
> workaround - not a solution.
>
> It might have been the best way to get the job done back when it had to
> work with existing Mercurial versions, but now when it is distributed with
> Mercurial we should have a proper solution - possibly by modifying core
> Mercurial so the extension has a chance to handle it decently.
>

If you have pointers on how to fix it in a more proper way, then I'm all
ears.  I am pretty sure the largefiles extension is not considered
important enough to get any special treatment in core Mercurial, though.

But my main concern with this patch is to remove an instance of obviously
bad/incorrect/confusing behavior before the 2.1 code freeze.

Yes, we've got to be sure that we're developing the codebase in the best
direction possible, and I support that 110%.  But not at the expense of
ignoring what the users see in real-world application.

Na'Tosha

-- 
*Na'Tosha Bard*
Build & Infrastructure 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/20120112/0bba7a68/attachment.html>


More information about the Mercurial-devel mailing list