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

Mads Kiilerich mads at kiilerich.com
Thu Jan 12 07:27:03 CST 2012


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 88edae221c023d2073f4e2d45b120f76766c73ef
> # Parent  c47d69ce5208d5b5cfd2fb2f0f1d7a2b4795fbf5
> 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.

/Mads


More information about the Mercurial-devel mailing list