Bug 3197 - largefiles: localized exception passed through
Summary: largefiles: localized exception passed through
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: largefiles (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Na'Tosha Bard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 06:49 UTC by Andrei Polushin
Modified: 2012-09-30 16:19 UTC (History)
7 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Polushin 2012-01-12 06:49 UTC
First, look at hgext/largefiles/overrides.py:

415:        except util.Abort, e:
416:            if str(e) != 'no files to copy':
417:                raise e

502:        except util.Abort, e:
503:            if str(e) != 'no files to copy':
504:                raise e

511:    if nolfiles and nonormalfiles:
512:        raise util.Abort(_('no files to copy'))

The exception raised with i18n-ed string, while except statement checks for
plain string. As a result, the exception is not caught on localized systems.

Steps to reproduce:
1. Use localized Mercurial
2. Enable largefiles extension
3. On existing repository, try to rename any file: hg move foo bar

Result:
1. The file is moved successfully
2. Extra message is printed, in its localized form:
   abort: no files to copy

Expected result:
   No extra message is expected.
Comment 1 Martin Geisler 2012-01-12 08:38 UTC
Wow, that "various" guy introduced a lot of funny code in cfccd3bee7b3 :-)
Comment 2 Na'Tosha Bard 2012-01-12 14:13 UTC
Yeah, no kidding.  You just can't trust that guy . . .
Comment 3 Matt Mackall 2012-01-30 17:04 UTC
Discussion: http://mercurial.markmail.org/thread/hdeu44exiyzphpx6
Comment 4 Bugzilla 2012-05-12 09:26 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:26 EDT  ---

This bug was previously known as _bug_ 3196 at http://mercurial.selenic.com/bts/issue3196

Bug Status was UNCONFIRMED but everconfirmed was true
   Setting status to CONFIRMED

Comment 5 HG Bot 2012-07-27 14:00 UTC
Fixed by http://selenic.com/repo/hg/rev/c4ebdc36c17e
Matt Mackall <mpm@selenic.com>
largefiles: fix exception hack for i18n (issue3197)

Properly fixing this is quite a bit trickier.

(please test the fix)
Comment 6 Matt Mackall 2012-09-30 16:19 UTC
Mass close old bugs in testing.