Merge lp:~lifeless/bzr/commit into lp:bzr

Proposed by Robert Collins
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~lifeless/bzr/commit
Merge into: lp:bzr
Diff against target: 74 lines (+11/-4)
2 files modified
bzrlib/builtins.py (+2/-0)
bzrlib/commit.py (+9/-4)
To merge this branch: bzr merge lp:~lifeless/bzr/commit
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+22848@code.launchpad.net

Commit message

Record the new revision id a commit creates to ~/.bzr.log.

Description of the change

Log revision id to help debugging bzr-builddeb etc from log files.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

The revprops change is a bit of noise, but I don't think it is harmful. I doubt there are other paths that subclass it.

The mutter() change seems like a positive thing.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/builtins.py'
2--- bzrlib/builtins.py 2010-04-05 21:50:59 +0000
3+++ bzrlib/builtins.py 2010-04-06 06:44:35 +0000
4@@ -3158,9 +3158,11 @@
5 my_message = my_message.replace('\r\n', '\n')
6 my_message = my_message.replace('\r', '\n')
7 if my_message is None and not file:
8+ # t is the status of the tree
9 t = make_commit_message_template_encoded(tree,
10 selected_list, diff=show_diff,
11 output_encoding=osutils.get_user_encoding())
12+ # start_message is the template generated from hooks
13 start_message = generate_commit_message_template(commit_obj)
14 my_message = edit_commit_message_encoded(t,
15 start_message=start_message)
16
17=== modified file 'bzrlib/commit.py'
18--- bzrlib/commit.py 2010-02-17 17:11:16 +0000
19+++ bzrlib/commit.py 2010-04-06 06:44:35 +0000
20@@ -147,6 +147,12 @@
21
22 def completed(self, revno, rev_id):
23 self._note('Committed revision %d.', revno)
24+ # self._note goes to the console too; so while we want to log the
25+ # rev_id, we can't trivially only log it. (See bug 526425). Long
26+ # term we should rearrange the reporting structure, but for now
27+ # we just mutter seperately. We mutter the revid and revno together
28+ # so that concurrent bzr invocations won't lead to confusion.
29+ mutter('Committed revid %s as revno %d.', rev_id, revno)
30
31 def deleted(self, path):
32 self._note('deleted %s', path)
33@@ -236,6 +242,7 @@
34 commit.
35 """
36 operation = OperationWithCleanups(self._commit)
37+ self.revprops = revprops or {}
38 return operation.run(
39 message=message,
40 timestamp=timestamp,
41@@ -246,7 +253,6 @@
42 allow_pointless=allow_pointless,
43 strict=strict,
44 verbose=verbose,
45- revprops=revprops,
46 working_tree=working_tree,
47 local=local,
48 reporter=reporter,
49@@ -257,7 +263,7 @@
50 possible_master_transports=possible_master_transports)
51
52 def _commit(self, operation, message, timestamp, timezone, committer,
53- specific_files, rev_id, allow_pointless, strict, verbose, revprops,
54+ specific_files, rev_id, allow_pointless, strict, verbose,
55 working_tree, local, reporter, config, message_callback, recursive,
56 exclude, possible_master_transports):
57 mutter('preparing to commit')
58@@ -299,7 +305,6 @@
59 self.specific_files = None
60
61 self.allow_pointless = allow_pointless
62- self.revprops = revprops
63 self.message_callback = message_callback
64 self.timestamp = timestamp
65 self.timezone = timezone
66@@ -371,7 +376,7 @@
67 # Collect the changes
68 self._set_progress_stage("Collecting changes", counter=True)
69 self.builder = self.branch.get_commit_builder(self.parents,
70- self.config, timestamp, timezone, committer, revprops, rev_id)
71+ self.config, timestamp, timezone, committer, self.revprops, rev_id)
72
73 try:
74 self.builder.will_record_deletes()