Rev 5161: (lifeless) Inform users that a file specified to commit is an ignored in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Apr 16 09:27:23 BST 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5161 [merge]
revision-id: pqm at pqm.ubuntu.com-20100416082718-2xyomvwrh6mseg01
parent: pqm at pqm.ubuntu.com-20100415180955-v9jh960r07pva92c
parent: arnaud.jeansen at gmail.com-20100415202204-862f6y0nh76dhpjp
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-04-16 09:27:18 +0100
message:
(lifeless) Inform users that a file specified to commit is an ignored
unversioned file. (Arnaud Jeansen)
modified:
bzrlib/status.py status.py-20050505062338-431bfa63ec9b19e6
bzrlib/tests/blackbox/test_status.py teststatus.py-20050712014354-508855eb9f29f7dc
=== modified file 'bzrlib/status.py'
--- a/bzrlib/status.py 2010-03-20 00:07:45 +0000
+++ b/bzrlib/status.py 2010-04-15 20:22:04 +0000
@@ -166,6 +166,20 @@
short=short, want_unchanged=show_unchanged,
want_unversioned=want_unversioned, show_ids=show_ids)
+ # show the ignored files among specific files (i.e. show the files
+ # identified from input that we choose to ignore).
+ if specific_files is not None:
+ # Ignored files is sorted because specific_files is already sorted
+ ignored_files = [specific for specific in
+ specific_files if new.is_ignored(specific)]
+ if len(ignored_files) > 0 and not short:
+ to_file.write("ignored:\n")
+ prefix = ' '
+ else:
+ prefix = 'I '
+ for ignored_file in ignored_files:
+ to_file.write("%s %s\n" % (prefix, ignored_file))
+
# show the new conflicts only for now. XXX: get them from the
# delta.
conflicts = new.conflicts()
=== modified file 'bzrlib/tests/blackbox/test_status.py'
--- a/bzrlib/tests/blackbox/test_status.py 2010-03-25 09:39:03 +0000
+++ b/bzrlib/tests/blackbox/test_status.py 2010-04-07 21:34:13 +0000
@@ -472,6 +472,39 @@
self.assertEqual("working tree is out of date, run 'bzr update'\n",
err)
+ def test_status_on_ignored(self):
+ """Tests branch status on an unversioned file which is considered ignored.
+
+ See https://bugs.launchpad.net/bzr/+bug/40103
+ """
+ tree = self.make_branch_and_tree('.')
+
+ self.build_tree(['test1.c', 'test1.c~', 'test2.c~'])
+ result = self.run_bzr('status')[0]
+ self.assertContainsRe(result, "unknown:\n test1.c\n")
+ short_result = self.run_bzr('status --short')[0]
+ self.assertContainsRe(short_result, "\? test1.c\n")
+
+ result = self.run_bzr('status test1.c')[0]
+ self.assertContainsRe(result, "unknown:\n test1.c\n")
+ short_result = self.run_bzr('status --short test1.c')[0]
+ self.assertContainsRe(short_result, "\? test1.c\n")
+
+ result = self.run_bzr('status test1.c~')[0]
+ self.assertContainsRe(result, "ignored:\n test1.c~\n")
+ short_result = self.run_bzr('status --short test1.c~')[0]
+ self.assertContainsRe(short_result, "I test1.c~\n")
+
+ result = self.run_bzr('status test1.c~ test2.c~')[0]
+ self.assertContainsRe(result, "ignored:\n test1.c~\n test2.c~\n")
+ short_result = self.run_bzr('status --short test1.c~ test2.c~')[0]
+ self.assertContainsRe(short_result, "I test1.c~\nI test2.c~\n")
+
+ result = self.run_bzr('status test1.c test1.c~ test2.c~')[0]
+ self.assertContainsRe(result, "unknown:\n test1.c\nignored:\n test1.c~\n test2.c~\n")
+ short_result = self.run_bzr('status --short test1.c test1.c~ test2.c~')[0]
+ self.assertContainsRe(short_result, "\? test1.c\nI test1.c~\nI test2.c~\n")
+
def test_status_write_lock(self):
"""Test that status works without fetching history and
having a write lock.
More information about the bazaar-commits
mailing list