[MERGE] default user ignores in ~/.bazaar/ignore

John Arbash Meinel john at arbash-meinel.com
Wed Jul 19 19:57:49 BST 2006

Hash: SHA1

Martin Pool wrote:
> On 12 Jul 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
>> The attached patch changes our default ignore policy, to hopefully bring
>> about a nice intermediate. There are several steps to accomplish this:
> +1 to the end result and how you got there.
>> +def get_user_ignores():
>> +    """Get the list of user ignored files, possibly creating it."""
>> +    path = config.user_ignore_config_filename()
>> +    patterns = USER_DEFAULTS[:]
>> +    try:
>> +        f = open(path, 'rb')
>> +    except (IOError, OSError), e:
>> +        if e.errno not in (errno.ENOENT,):
>> +            raise
> We have in the past had 'getattr(e, 'errno')', in case it was not there.
> I don't think that will happen on access to normal local files though --
> from memory it was urllib raising an IOError that wasn't...

It is small, so I put it back in. But yeah, I would guess it wasn't
open() that was returning an IOError with no errno.

> It's more consistent with other code and PEP8 to have the commas at the
> end of the lines, and one entry per line.  Also there should be a blank
> here.

Thanks for the catch. My personal coding style uses opening ',', and I
occasionally revert back. (Comes from C/C++ where you can't have a
trailing ',' so adding new entries to the end always messes up your diff.)

>> +
>> +
>> +def deprecated_list(deprecation_version, variable_name,
>> +                    initial_value, extra=None):
>> +    """Create a list that warns when modified
>> +
>> +    :param deprecation_version: something like zero_nine
>> +    :param initial_value: The contents of the list
>> +    :param variable_name: This allows better warnings to be printed
>> +    :param extra: Extra info to print when printing a warning
>> +    """
> OK you definitely get brownie points for adding a test for this :-)

Thanks. I'll make the small fixes you mention, and submit.
Then I'll work on another patch to add a function to add runtime ignore


Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list