[MERGE] default user ignores in ~/.bazaar/ignore
John Arbash Meinel
john at arbash-meinel.com
Thu Jul 13 01:25:44 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The attached patch changes our default ignore policy, to hopefully bring
about a nice intermediate. There are several steps to accomplish this:
1) move the old default ignore list out of bzrlib/__init_.py and into a
new file bzrlib/ignores.py
2) leave a stub DEFAULT_IGNORE in bzrlib/__init__.py, which gives
deprecation warnings when append/extend/insert/pop/remove are called on
it. Plugins can still add entries there, and they will be ignored, but
it is now deprecated.
3) When checking for ~/.bazaar/ignore, create it if it does not exist.
And populate it with a new short-list of ignores.
This lets us maintain our ease-of-use (bzr init; bzr add; bzr commit;
will 90+% of the time version the right files). I thought about not
creating the file, but it just leaves the old problem that "once it
exists, all the rules change". If a user wanted to add just 1 new global
rule, they would have to figure out what the original ones were.
4) Give some nice helper functions in bzrlib/ignores.py, including:
add_unique_user_ignores(), which takes a list of ignore patterns, and
only updates ~/.bazaar/ignore if the entry does not exist yet.
It still requires reading the file, and parsing the list, but it gives
plugins a way to do what they need, rather than having all of them do it
ad-hoc.
5) Fix a bunch of tests that didn't expect .bazaar to show up in their
working directory. Because we set $HOME to the same dir as the tests are
being run. This also includes cleaning up the 'bzr ls' tests, by putting
them into their own file, and breaking them up into a better set of tests.
I would really like to see this (or something like it) merged for 0.9,
since I think it preserves the bzr 0.8 user experience. So I would
appreciate quick reviews so that I can fix it, and get it merged.
Ultimately this patch also fixes some parsing bugs (the old is_ignored
parser didn't ignore blank lines or comment lines, this is now tested for).
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEtZMIJdeBCYSNAAMRAlvDAKCy0IxsGxD8f0WN4mpwwYkzqkFW6QCgj+7z
mc5Q55k7Uy1f20AHJl6m8O8=
=48CC
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default-user-ignores.diff
Type: text/x-patch
Size: 57946 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060712/6e5c3c6f/attachment.bin
More information about the bazaar
mailing list