Rev 3897: Start Ian's review fixes. in file:///net/bigmamac/Volumes/home/vila/src/bzr/cases/3232-spurious-conflict/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Jan 7 15:39:21 GMT 2009
At file:///net/bigmamac/Volumes/home/vila/src/bzr/cases/3232-spurious-conflict/
------------------------------------------------------------
revno: 3897
revision-id: v.ladeuil+lp at free.fr-20090107153920-1wj976bx3rxsdrcv
parent: v.ladeuil+lp at free.fr-20081217162451-eme6wed1acy0hdhf
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: log-deep
timestamp: Wed 2009-01-07 16:39:20 +0100
message:
Start Ian's review fixes.
* bzrlib/tests/blackbox/test_log.py:
(TestLogFileDeep.test_log_old_file_deep,
TestLogFileDeep.test_log_file_deep_short): Group related tests,
fix bug in regexp.
* bzrlib/log.py:
(_show_log): Get rid of the useless try/finally.
(_filter_revisions_touching_file_id): Fix comment typos.
* NEWS:
Fix typos.
-------------- next part --------------
=== modified file 'BRANCH.TODO'
--- a/BRANCH.TODO 2008-07-03 04:03:02 +0000
+++ b/BRANCH.TODO 2009-01-07 15:39:20 +0000
@@ -3,3 +3,7 @@
#
#
+ Ian> I'd like to see the help for the log command expanded
+ Ian> quite a bit as part of this patch. I think it needs to
+ Ian> explain file-id-based vs file-path-based logging and
+ Ian> include examples of both.
=== modified file 'NEWS'
--- a/NEWS 2008-12-17 16:24:51 +0000
+++ b/NEWS 2009-01-07 15:39:20 +0000
@@ -20,8 +20,8 @@
NEW FEATURES:
- * ``bzr log`` now accepts a --deep option to look at files not present
- anymore in the working tree. Be aware that the actual implementation is
+ * ``bzr log`` now accepts a --deep option to look at files not present any
+ more in the working tree. Be aware that the actual implementation is
slow as it needs to search all revisions, so restricting the required
revisions (as in providing ``-r-25..`` may help).
(Vincent Ladeuil, #175520)
@@ -42,9 +42,8 @@
* Allow BzrDir implementation to implement backing up of
control directory. (#139691)
- * ``bzr log -v FILE`` don't display the whole inventory anymore. Only the
- line about FILE is displayed.
- (Vincent Ladeuil)
+ * ``bzr log -v FILE`` doesn't display the whole inventory anymore. Only
+ the line about FILE is displayed. (Vincent Ladeuil)
* Don't call iteritems on transport_list_registry, because it may
change during iteration. (Martin Pool, #277048)
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py 2008-12-17 16:24:51 +0000
+++ b/bzrlib/log.py 2009-01-07 15:39:20 +0000
@@ -228,13 +228,11 @@
for revs in revision_iterator:
for (rev_id, revno, merge_depth), rev, delta in revs:
if _path_filter is not None:
- try:
- if _filter_delta(delta, _path_filter) == 0:
- continue
- finally:
- if not generate_delta:
- # We don't need the delta anymore
- delta = None
+ if _filter_delta(delta, _path_filter) == 0:
+ continue
+ if not generate_delta:
+ # We don't need the delta anymore
+ delta = None
lr = LogRevision(rev, revno, merge_depth, delta,
rev_tag_dict.get(rev_id))
lf.log_revision(lr)
@@ -597,7 +595,7 @@
:return: A list of (revision_id, dotted_revno, merge_depth) tuples.
"""
# Lookup all possible text keys to determine which ones actually modified
- # the file. Note that this function use the fact that we create a new text
+ # the file. Note that this function uses the fact that we create a new text
# only when a file is created or modified. We don't need to access every
# inventory to find them, we just use the text index (which is the heart of
# the optimization).
@@ -638,7 +636,7 @@
if rev_id in modified_text_revisions:
# This needs to be logged, along with the extra revisions It's
- # important to understand that the test above identify all the
+ # important to understand that the test above identifies all the
# revisions that add or modify the given file-id but *not* the ones
# that *remove* it (that's bug #181520).
for idx in xrange(len(current_merge_stack)):
=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py 2008-12-12 13:03:09 +0000
+++ b/bzrlib/tests/blackbox/test_log.py 2009-01-07 15:39:20 +0000
@@ -603,23 +603,23 @@
self.assertNotContainsRe(log, ' f1\n')
self.assertContainsRe(log, ' f2\n')
- def test_log_file_not_deep_short(self):
+ def test_log_old_file_deep(self):
+ log = self.run_bzr(['log', '-v', '--short', '--deep', 'f1'])[0]
+ # revnos 1 and 2 appear and mention adding and deleting f1
+ self.assertContainsRe(log, '(?sm)^ +2 joe.*D f1\n.*^ +1 joe.*A f1\n')
+ self.assertNotContainsRe(log, '(?sm)^ +3 joe')
+
+ def test_log_file_deep_short(self):
log = self.run_bzr(['log', '-v', '--deep', '--short', 'f2'])[0]
# revnos 1 and 3 appear and mention adding f2
self.assertContainsRe(log, '(?sm)^ +3 joe.*A f2\n.*^ +1 joe.*A f2\n')
# revno 2 appears and mentions deleting f2
- self.assertNotContainsRe(log, '(?sm)^ +2 joe.*D f2\n')
+ self.assertContainsRe(log, '(?sm)^ +2 joe.*D f2\n')
def test_log_old_file_not_deep(self):
# Without deep, we can't query an old file
log = self.run_bzr(['log', '-v', 'f1'], retcode=3)[0]
- def test_log_old_file_deep(self):
- log = self.run_bzr(['log', '-v', '--short', '--deep', 'f1'])[0]
- # revnos 1 and 2 appear and mention adding and deleting f1
- self.assertContainsRe(log, '(?sm)^ +2 joe.*D f1\n.*^ +1 joe.*A f1\n')
- self.assertNotContainsRe(log, '(?sm)^ +3 joe')
-
def test_log_deep_without_file_warns(self):
log, err = self.run_bzr(['log', '--deep'])
self.assertEquals('No file specified, --deep ignored\n', err)
More information about the bazaar-commits
mailing list