Rev 1434: Use NULL_REVISION rather that None. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Fri Jul 4 01:59:17 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/trunk

------------------------------------------------------------
revno: 1434
revision-id: jelmer at samba.org-20080704005915-12e0gyhi4fa7v6c9
parent: jelmer at samba.org-20080703234748-lof3z0n5j7kzhoyy
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2008-07-04 02:59:15 +0200
message:
  Use NULL_REVISION rather that None.
modified:
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
=== modified file 'commit.py'
--- a/commit.py	2008-07-03 23:47:48 +0000
+++ b/commit.py	2008-07-04 00:59:15 +0000
@@ -150,12 +150,12 @@
         # Gather information about revision on top of which the commit is 
         # happening
         if parents == []:
-            self.base_revid = None
+            self.base_revid = NULL_REVISION
         else:
             self.base_revid = parents[0]
 
         self.base_revno = self.branch.revision_id_to_revno(self.base_revid)
-        if self.base_revid is None:
+        if self.base_revid == NULL_REVISION:
             self.base_revnum = -1
             self.base_path = None
             self.base_mapping = repository.get_mapping()
@@ -164,7 +164,7 @@
                 repository.lookup_revision_id(self.base_revid)
 
         if old_inv is None:
-            if self.base_revid is None:
+            if self.base_revid == NULL_REVISION:
                 self.old_inv = Inventory(root_id=None)
             else:
                 self.old_inv = self.repository.get_inventory(self.base_revid)
@@ -179,7 +179,7 @@
 
         self.modified_files = {}
         self.modified_dirs = set()
-        if self.base_revid is None:
+        if self.base_revid == NULL_REVISION:
             base_branch_props = {}
         else:
             base_branch_props = lazy_dict({}, self.repository.branchprop_list.get_properties, self.base_path, self.base_revnum)
@@ -788,7 +788,7 @@
     # revision on top of which to commit
     if push_metadata:
         if rev.parent_ids == []:
-            base_revid = None
+            base_revid = NULL_REVISION
         else:
             base_revid = rev.parent_ids[0]
     else:




More information about the bazaar-commits mailing list