[Pkg-bazaar-commits] ./bzr/unstable r339: many more diffs
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 07:43:47 UTC 2009
------------------------------------------------------------
revno: 339
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-05-03 19:27:28 +1000
message:
many more diffs
modified:
TODO
testbzr
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO 2005-05-03 08:00:27 +0000
+++ b/TODO 2005-05-03 09:27:28 +0000
@@ -185,6 +185,11 @@
* Branch names?
+* More test framework:
+
+ - Class that describes the state of a working tree so we can just
+ assert it's equal.
+
=== modified file 'testbzr'
--- a/testbzr 2005-05-03 08:04:38 +0000
+++ b/testbzr 2005-05-03 09:27:28 +0000
@@ -25,6 +25,8 @@
This replaces the previous test.sh which was not very portable."""
import sys, os, traceback
+from os import mkdir
+from os.path import exists
TESTDIR = "testbzr.tmp"
@@ -172,6 +174,43 @@
assert backtick("bzr revno") == '0\n'
+ progress("add first revision")
+ runcmd(["bzr", "commit", "-m", 'add first revision'])
+
+ progress("more complex renames")
+ os.mkdir("sub1")
+ runcmd("bzr rename hello.txt sub1", 1)
+ runcmd("bzr rename hello.txt sub1/hello.txt", 1)
+ runcmd("bzr move hello.txt sub1", 1)
+
+ runcmd("bzr add sub1")
+ runcmd("bzr rename sub1 sub2")
+ runcmd("bzr move hello.txt sub2")
+
+ assert exists("sub2")
+ assert exists("sub2/hello.txt")
+ assert not exists("sub1")
+ assert not exists("hello.txt")
+
+ runcmd(['bzr', 'commit', '-m', 'commit with some things moved to subdirs'])
+
+ mkdir("sub1")
+ runcmd('bzr add sub1')
+ runcmd('bzr move sub2/hello.txt sub1')
+ assert not exists('sub2/hello.txt')
+ assert exists('sub1/hello.txt')
+ runcmd('bzr move sub2 sub1')
+ assert not exists('sub2')
+ assert exists('sub1/sub2')
+
+ runcmd(['bzr', 'commit', '-m', 'rename nested subdirectories'])
+
+ cd('sub1/sub2')
+ runcmd('bzr move ../hello.txt .')
+ assert exists('../hello.txt')
+ runcmd(['bzr', 'commit', '-m', 'move to parent directory'])
+ cd('..')
+
cd('..')
progress("all tests passed!")
More information about the Pkg-bazaar-commits
mailing list