Follow upstream changes -- rest
[git-darcs-import.git] / tests / partial.sh
blob6bd9d3110f6ac5471b4991d3b1e3a57bdc9ddc78
1 #!/usr/bin/env bash
3 # A partial get of a repo shall have the same _darcs/pristine as the original
5 set -ev
7 rm -rf temp
8 mkdir temp
9 cd temp
11 # Create a development repo, do some work
13 darcs initialize --darcs-2
14 echo ALL ignore-times >> _darcs/prefs/defaults
15 touch a
16 darcs add a
17 darcs record -a -m aa -A x
18 touch b
19 darcs add b
20 darcs record -a -m bb -A x
22 # Create a release repo, pull the good patches and tag it
24 mkdir _rel
25 cd _rel
26 darcs initialize --darcs-2
27 darcs pull -a --patch a ..
28 darcs tag -m tt -A x
29 cd ..
31 # Pull the tag to the devel repo and continue developement
33 darcs pull -a _rel
34 touch c
35 darcs add c
36 darcs record -a -m cc -A x
38 # Create a checkpoint and get a partial temp repo
40 darcs tag -A x --checkpoint first_checkpoint
41 darcs get --partial . _partial
43 # We should have all our devel files
45 cd _partial
46 cat a
47 cat b
48 cat c
50 # This is a regression test for issue406
51 darcs tag -A x --checkpoint checkpointing_a_partial
53 cd ..
55 # With the darcs-2 format, doing a get on a partial repo succeeds.
56 # With the darcs-1 format it would be required to add the --partial flag, or darcs would give an error.
57 darcs get _partial _second_partial
59 cd ..
60 rm -rf temp