5 ## I would use the builtin !, but that has the wrong semantics.
6 not
() { "$@" && exit 1 ||
:; }
23 echo darcs pull should work relative to the current directory
24 darcs pull
-a ..
/..
/..
/temp1 |
grep -i 'No remote changes to pull in'
26 echo -- darcs pull should pull into repo specified with
--repo
27 cd ..
/..
# now in temp2
29 darcs record
--patch-name uno
--all
30 cd ..
# now outside of any repo
31 darcs pull
--repodir temp1
--all ..
/temp2 |
grep -i 'Finished pulling.' # temp2 is relative to temp1
34 date > temp
2/one
/date.t
35 darcs add
--repodir .
/temp2 one
/date.t
36 darcs record
--repodir .
/temp2
-a -m foo
38 # set up client repo for failure
39 chmod a-rwx .
/temp
1/one
# remove all permissions
40 not darcs pull
--repodir .
/temp1
-a 2> err
41 chmod u
+rwx temp
1/one
# restore permission
44 if echo $OS |
grep -i windows
; then
45 echo this
test does not work on windows
, so ignore it
47 if whoami |
grep root
; then
48 echo root never gets permission denied
50 grep 'permission denied' err
56 echo Before trying to pull from self
, defaultrepo is something
else
57 not
grep temp1 _darcs
/prefs
/defaultrepo
59 #return special message when you try to pull from yourself
61 not darcs pull
-a "$DIR" 2> out
63 grep 'Can.t pull from current repository' out
65 not darcs pull
-a .
2> out
67 grep 'Can.t pull from current repository' out
69 # and do not update the default repo to be the current di
70 not
grep temp1 _darcs
/prefs
/defaultrepo
72 rm -f _darcs
/prefs
/defaultrepo
74 grep 'please specify one' err
75 echo .
> _darcs
/prefs
/defaultrepo
77 grep 'Can.t pull from current repository' err
79 not darcs pull ..
/* 2> out
81 not
grep 'Can.t pull from current repository' out
82 cd ..
# now outside of any repo
91 darcs rollback
-p CC
-a -m unC
94 darcs get
--to-patch B temp1 temp2
96 sleep 1 # So that rollback won't have same timestamp as get.
97 darcs rollback
-p BB
-a -m unB
99 darcs pull
-a ..
/temp1
2> err
100 not
grep 'Error applying patch' err
106 darcs record
-am newbaz
108 darcs pull
-a |
grep Finished
110 darcs record
-am bazbar
112 darcs pull ..
/temp2
-a
113 echo -n bar
> correct_baz
117 # my $test_name = "when a patch creating a directory is attempted to be applied
118 # while a directory with that name already exists, a warning is raised, but
119 # the pull succeeds.";
123 darcs record
-am newdir
126 darcs pull
-a ..
/temp1
&> out
129 grep 'Finished pulling' out
136 # A test for issue662, which triggered:
137 # darcs failed: Error applying hunk to file ./t.t
138 # Error applying patch to the working directory.
141 darcs init
--hashed --repodir=tmp
146 darcs record
-am 'initial add' --ignore
147 echo 'content: remote change'>t.t
148 darcs record
-am 'remote change' --ignore
151 darcs obliterate
--last 1 --all;
152 echo 'content: local change'> t.t