[darcs-devel] darcs patch: add test to trigger yet another buggy
case.
Eric Y. Kow
eric.kow at gmail.com
Sat May 5 11:01:45 PDT 2007
On Sat, May 05, 2007 at 07:37:49 -0700, David Roundy wrote:
> I still can't reproduce your problem with this test case. It passes in my
> repository. Can you try with it again?
Here's what I get (both on MacOS X and Linux)
Linking darcs ...
compilation IS NOT required
: -o darcs
Running hashed_inventory.sh ... passed.
All tests successful!
Running hashed_inventory.sh ... FAILED!
Output from failed hashed_inventory.sh:
# We'd just use `diff -x _darcs -r' if -x was portable.
diffx () {
{ find $1 -type f; find $2 -type f; } |
sed -e '/.*\/_darcs\//d' -e 's;^[^/]*;;' | sort | uniq |
{
while read part; do
diff -c $1$part $2$part
done
}
}
test $DARCS || DARCS=$PWD/../darcs
rm -rf temp1 temp2 temp3 temp4 temp5
mkdir temp1
cd temp1
$DARCS init --hashed-inventory
touch foo
$DARCS add foo
$DARCS rec -m t1 -a -A tester
Finished recording patch 't1'
echo 1 >> foo
$DARCS what -s | grep -v No\ changes
M ./foo +1
$DARCS what -l | grep -v No\ changes
M ./foo +1
$DARCS what -sl | grep -v No\ changes
M ./foo +1
cd ..
$DARCS get temp1 temp2
Applying patch 1 of 1... done.
Finished getting.
cd temp2
$DARCS changes
Sat May 5 19:48:53 CEST 2007 tester
* t1
cd ..
$DARCS get --hashed-inventory temp1 temp3
Applying patch 1 of 1... done.
Finished getting.
cd temp3
$DARCS changes
Sat May 5 19:48:53 CEST 2007 tester
* t1
cp _darcs/hashed_inventory inv
$DARCS optimize
Done optimizing!
diff -c inv _darcs/hashed_inventory
rm inv
cd ..
diffx temp2 temp3
diff -rc temp1/_darcs/pristine temp3/_darcs/pristine
diff -rc temp2/_darcs/pristine temp3/_darcs/pristine
cd temp1
$DARCS record -a -A tester -m t2
Finished recording patch 't2'
$DARCS push ../temp2 -a
Finished applying...
$DARCS push ../temp3 -a
Finished applying...
cd ..
diffx temp2 temp3
diff -rc temp1/_darcs/pristine temp3/_darcs/pristine
diff -rc temp2/_darcs/pristine temp3/_darcs/pristine
cd temp1
date > foo
$DARCS record -a -A tester -m t3
Finished recording patch 't3'
cd ../temp2
$DARCS pull -a
Pulling from "/Users/kowey/darcsImpl/more-unstable/tests/temp1"...
Finished pulling and applying.
cd ../temp3
$DARCS pull -a
Pulling from "/Users/kowey/darcsImpl/more-unstable/tests/temp1"...
Finished pulling and applying.
$DARCS check
Checking patch 3 of 3... done.
The repository is consistent!
cd ..
diffx temp2 temp3
diff -rc temp1/_darcs/pristine temp3/_darcs/pristine
diff -rc temp2/_darcs/pristine temp3/_darcs/pristine
cd temp1
$DARCS put --hashed-inventory ../temp4
Finished applying...
cd ..
diffx temp2 temp4
diff -rc temp2/_darcs/pristine temp4/_darcs/pristine
cd temp1
$DARCS tag -A tagger -m atag
Finished tagging patch 'TAG atag'
$DARCS check
Checking patch 4 of 4... done.
The repository is consistent!
$DARCS optimize
Done optimizing!
$DARCS check
Checking patch 4 of 4... done.
The repository is consistent!
$DARCS changes | grep t1
* t1
cd ..
cd temp3
date > foobarpatch
$DARCS add foobarpatch
$DARCS record -a -A silly -m foobarpatch
Finished recording patch 'foobarpatch'
$DARCS check
Checking patch 4 of 4... done.
The repository is consistent!
$DARCS optimize
Done optimizing!
$DARCS check
Checking patch 4 of 4... done.
The repository is consistent!
$DARCS pull -a ../temp1
Finished pulling and applying.
$DARCS check
Checking patch 5 of 5... done.
The repository is consistent!
$DARCS optimize --reorder-patches
Done optimizing!
$DARCS check
Checking patch 5 of 5... done.
The repository is consistent!
grep 'Starting with inventory' _darcs/hashed_inventory
Starting with inventory:
cd ..
cd temp1
$DARCS pull -a ../temp3
Finished pulling and applying.
cd ..
diff -c temp1/_darcs/hashed_inventory temp3/_darcs/hashed_inventory
cd temp4
$DARCS pull -p foobarpatch -a ../temp3
Finished pulling and applying.
$DARCS pull -a ../temp1
Finished pulling and applying.
$DARCS optimize --reorder
Done optimizing!
$DARCS check
Checking patch 5 of 5... done.
The repository is consistent!
$DARCS push ../temp1
Pushing to "../temp1"...
No recorded local changes to push!
cd ..
diff temp1/_darcs/hashed_inventory temp4/_darcs/hashed_inventory
rm -rf temp3
$DARCS get --old-fashioned temp1 temp3
Applying patch 5 of 5... done.
Finished getting.
$DARCS get --hashed-inventory temp3 temp5
Invalid repository: /Users/kowey/darcsImpl/more-unstable/tests/temp5
darcs failed: Couldn't fetch `e54faf4cc557b9d7813bfe6b4480ca59e5c51c27'
in subdir _darcs/inventories from sources:
thisrepo:/Users/kowey/darcsImpl/more-unstable/tests/temp5
TESTS FAILED!
hashed_inventory.sh
--
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070505/7cc80548/attachment.pgp
More information about the darcs-devel
mailing list