[MERGE] Minor docstring cleanups

John Arbash Meinel john at arbash-meinel.com
Fri May 2 20:35:16 BST 2008

Hash: SHA1

Robert Collins wrote:
| On Thu, 2008-05-01 at 12:19 -0500, John Arbash Meinel wrote:
|> Hash: SHA1
|> Ian Clatworthy wrote:
|> | This patch corrects a minor error in a deprecation string I came across
|> | while doing a review yesterday. It also adds a base method/docstring for
|> | MutableTree.put_file_bytes_non_atomic based on information Robert and
|> | Martin provided on IRC.
|> |
|> | Ian C.
|> |
|> If you want a small addition, you can say that it is meant for callers that
|> already know the target path does not already exist. (Either because it is a
|> temporary path, or they already probed for a file and failed.) You certainly
|> wouldn't have to, but that might also be helpful to know.
|> The only times I'm aware of right now are when uploading a pack file (to a
|> unique temp path), pushing a knit file after finding out the target doesn't
|> exist, and lock files because they also go into a unique temp directory.
| None of those apply to *MutableTree*.
| -Rob

I guess I should rephrase then.

The only callers of put_file_bytes_non_atomic is in the test suite. Via
TreeBuilder, and a few that are direct.

I believe it only exists as a test hook, because we wanted a way to start
abstracting tests so they could be run on a MemoryTree when all we wanted to do
was build up some commit history.

In other words, 95% of our tests shouldn't be needing to create a real
WorkingTree on disk, only the ones that are actually testing WT functionality
need to do that. But to get there, we need some abstractions for setting up the
tests. I don't think the work in this area is very far along, unfortunately, but
eventually we would see a lot of benefits from switching. Especially on windows
where the simple act of taking out a disk lock is rather expensive. (Measured in
10-100s of milliseconds, rather than sub-millisecond on Linux.)


Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list