5 ## I would use the builtin !, but that has the wrong semantics.
6 not
() { "$@" && exit 1 ||
:; }
8 # darcs does not support cygwin paths (/cygdrive/c/foo), so if
9 # we want to run the test suite under Cygwin Bash, we must
12 if uname |
grep -i cygwin
> /dev
/null
; then
35 echo darcs pull should work relative to the current directory
36 darcs pull
-a ..
/..
/..
/temp1 |
grep -i 'No remote changes to pull in'
38 echo -- darcs pull should pull into repo specified with
--repo
39 cd ..
/..
# now in temp2
41 darcs record
--patch-name uno
--all
42 cd ..
# now outside of any repo
43 darcs pull
--repodir temp1
--all temp2 |
grep -i 'Finished pulling.' # temp2 is not relative to temp1
46 date > temp
2/one
/date.t
47 darcs add
--repodir .
/temp2 one
/date.t
48 darcs record
--repodir .
/temp2
-a -m foo
50 # set up client repo for failure
51 if echo $OS |
grep -i windows
; then
52 echo this
test does not work on windows because it
53 echo is not possible to
chmod -r
54 elif whoami |
grep root
; then
55 echo root never gets permission denied
57 chmod a-rwx .
/temp
1/one
# remove all permissions
58 not darcs pull
--repodir .
/temp1
-a 2> err
59 chmod u
+rwx temp
1/one
# restore permission
61 grep 'permission denied' err
67 echo Before trying to pull from self
, defaultrepo is something
else
68 not
grep temp1 _darcs
/prefs
/defaultrepo
70 #return special message when you try to pull from yourself
73 not darcs pull
--debug -a "$DIR" 2> out
75 grep 'Can.t pull from current repository' out
77 not darcs pull
--debug -a .
2> out
79 grep 'Can.t pull from current repository' out
81 # and do not update the default repo to be the current di
82 not
grep temp1 _darcs
/prefs
/defaultrepo
84 rm -f _darcs
/prefs
/defaultrepo
86 grep 'please specify one' err
87 echo .
> _darcs
/prefs
/defaultrepo
88 not darcs pull
--debug 2> err
89 grep 'Can.t pull from current repository' err
91 not darcs pull
--debug ..
/* 2> out
93 not
grep 'Can.t pull from current repository' out
94 cd ..
# now outside of any repo
103 darcs rollback
-p CC
-a -m unC
106 darcs get
--to-patch B temp1 temp2
108 sleep 1 # So that rollback won't have same timestamp as get.
109 darcs rollback
-p BB
-a -m unB
111 darcs pull
-a ..
/temp1
2> err2
112 not
grep 'Error applying patch' err2
118 darcs record
-am newbaz
120 darcs pull
-a |
grep Finished
122 darcs record
-am bazbar
124 darcs pull ..
/temp2
-a
125 echo -n bar
> correct_baz
129 # my $test_name = "when a patch creating a directory is attempted to be applied
130 # while a directory with that name already exists, a warning is raised, but
131 # the pull succeeds.";
135 darcs record
-am newdir
138 darcs pull
-a ..
/temp1
&> out2
141 grep 'Finished pulling' out2
148 # A test for issue662, which triggered:
149 # darcs failed: Error applying hunk to file ./t.t
150 # Error applying patch to the working directory.
153 darcs init
--hashed --repodir=tmp
158 darcs record
-am 'initial add' --ignore
159 echo 'content: remote change'>t.t
160 darcs record
-am 'remote change' --ignore
163 darcs obliterate
--last 1 --all;
164 echo 'content: local change'> t.t