[MERGE] Quicker initial commit

John Arbash Meinel john at arbash-meinel.com
Thu Aug 30 18:28:47 BST 2007


John Arbash Meinel has voted tweak.
Status is now: Conditionally approved
Comment:
+        # If this is the initial commit for this file, we know the sha 
is
+        # coming later so skip caluculating it now (in 
_read_tree_state())

^- Typo: calculating

In general, I prefer using:
-            return work_tree.get_file(self.file_id).readlines()
+            return work_tree.get_file(self.file_id, path).readlines()

get_file_lines(id, path)

to

get_file().readlines()

I realize in this case they are equivalent. But 
RevisionTree.get_file_lines() is much more efficient than 
get_file().readlines().

get_file().readlines() is actually 
StringIO(''.join(self.get_file_lines())).readlines()

We have the api's, so I think it would be best to have practice using 
the right one. (not a big deal in this circumstance)


Tree.get_file() has undefined behavior when path and id would not point 
to the same object. I'm not sure how to handle this. We should at least 
define whether one has priority, if it is implementation defined, or if 
it should error.
I'm guessing it is going to be "implementation defined". Since WT 
prefers path, and RT prefers file_id. (Just based on how things are 
stored/accessed.)
We should at least document it.


For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C46D62791.2090100%40internode.on.net%3E



More information about the bazaar mailing list