[PATCH] testbzr can run commands in source directory

John A Meinel john at arbash-meinel.com
Thu Jun 16 18:30:14 BST 2005


The way testbzr is written, it creates a temporary directory, and then
starts running commands from that directory.

I found out by accident that if you just run "bzr commit -m foo" in that
directory, it will modify you working directory.

The following lines just create a local project so that while writing
tests if you make a mistake, it won't mess with your source directory.

John
=:->


*** modified file 'testbzr'
--- testbzr
+++ testbzr
@@ -265,6 +265,9 @@

     runcmd(['mkdir', TESTDIR])
     cd(TESTDIR)
+    # This means that any command that is naively run in this directory
+    # Won't affect the parent directory.
+    runcmd('bzr init')
     test_root = os.getcwd()

     progress("introductory commands")

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050616/78526fbc/attachment.pgp 


More information about the bazaar mailing list