[darcs-users] review darcs patch: Simplify EXAMPLE.sh.
kamil at dworakowski.name
Sun Sep 20 21:19:19 UTC 2009
Tue Aug 25 16:25:31 BST 2009 Eric Kow <kowey at darcs.net>
* Simplify EXAMPLE.sh.
1. Don't clean up. When you're working on just one test, it's easier
to figure out if the test is correct if you have access to the
repository. Pre-flight cleanup by all test scripts is now essential.
2. Don't rely on --repo except for init (where it saves some boilerplate)
a) Makes test scripts more natural and straightforward to write.
b) Reduces the number of variables that we are testing, ie.
ensuring that --repo path handling is working correctly at all times.
Good point. The --repo way is too verbose.
Below is the patch, which I have so edited that the removed lines
are followed by the lines that replaced them. It is easy to see that
the replacements are preserving behaviour save for the removed
cleanup at the end.
diff -rN old-example/tests/EXAMPLE.sh new-example/tests/EXAMPLE.sh
> cd R
< mkdir R/d/ R/e/ # Change the working tree.
> mkdir d e # Change the working tree.
< echo 'Example content.' >R/d/f
> echo 'Example content.' > d/f
< darcs record --repo R -lam 'Add d/f and e.'
> darcs record -lam 'Add d/f and e.'
< darcs mv --repo R d/f e/
> darcs mv d/f e/
< darcs record --repo R -am 'Move d/f to e/f.'
> darcs record -am 'Move d/f to e/f.'
< darcs push --repo R S -a # Try to push patches between repos.
> darcs push ../S -a # Try to push patches between repos.
< darcs push --repo S R
> cd ..
> cd S
> darcs push ../R -a
< rm -rf R/ S/ # Clean up after ourselves.
> cd ..
I don't have commit rights. If that review convinces anyone with the
privilege, please commit.
The patch can be downloaded from:
(I was not yet subscribed to the list when that patch came in).
More information about the darcs-users