Rev 3783: Move --unchanged detection in commit into the CommitBuilder. in http://people.ubuntu.com/~robertc/baz2.0/commit-iterchanges

Robert Collins robertc at robertcollins.net
Tue Nov 18 03:02:26 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/commit-iterchanges

------------------------------------------------------------
revno: 3783
revision-id: robertc at robertcollins.net-20081118030221-u9cx70qw029tg2b5
parent: robertc at robertcollins.net-20081118024351-btz27tj0cohw0qjc
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit-iterchanges
timestamp: Tue 2008-11-18 14:02:21 +1100
message:
  Move --unchanged detection in commit into the CommitBuilder.
modified:
  bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2008-10-13 04:43:31 +0000
+++ b/bzrlib/commit.py	2008-11-18 03:02:21 +0000
@@ -257,7 +257,6 @@
                                " parameter is required for commit().")
 
         self.bound_branch = None
-        self.any_entries_changed = False
         self.any_entries_deleted = False
         if exclude is not None:
             self.exclude = sorted(
@@ -438,7 +437,7 @@
         # unless deletes occured, in which case the length is irrelevant.
         if (self.any_entries_deleted or 
             (len(self.builder.new_inventory) != 1 and
-             self.any_entries_changed)):
+             self.builder.any_entries_changed())):
             return
         raise PointlessCommit()
 
@@ -688,10 +687,8 @@
                 # required after that changes.
                 if len(self.parents) > 1:
                     ie.revision = None
-                _, version_recorded, _ = self.builder.record_entry_contents(
-                    ie, self.parent_invs, path, self.basis_tree, None)
-                if version_recorded:
-                    self.any_entries_changed = True
+                self.builder.record_entry_contents(ie, self.parent_invs, path,
+                    self.basis_tree, None)
 
     def _report_and_accumulate_deletes(self):
         # XXX: Could the list of deleted paths and ids be instead taken from
@@ -842,10 +839,8 @@
             ie.revision = None
         # For carried over entries we don't care about the fs hash - the repo
         # isn't generating a sha, so we're not saving computation time.
-        _, version_recorded, fs_hash = self.builder.record_entry_contents(
+        _, _, fs_hash = self.builder.record_entry_contents(
             ie, self.parent_invs, path, self.work_tree, content_summary)
-        if version_recorded:
-            self.any_entries_changed = True
         if report_changes:
             self._report_change(ie, path)
         if fs_hash:




More information about the bazaar-commits mailing list