4 if [ x
${REMOTE_DIR} = x
]; then
8 if [ x
"${USE_PUTTY}" != x
]; then
17 if [ x
"${USE_CONTROL_MASTER}" != x
]; then
18 DARCS_SSH_FLAGS
="--ssh-cm"
19 export DARCS_SSH_FLAGS
22 if [ x
"${DARCS_SSH}" = x
]; then
37 if [ x
${REMOTE} = x
]; then
39 echo "Note: to enable full SSH testing, set REMOTE to some SSH path first,"
40 echo " e.g. REMOTE=you@server.org $0"
42 exit 0 # exit normally in case we are being run from the shell harness
45 # ================ Setting up remote repositories ===============
47 rm -rf ${REMOTE_DIR}; \
48 mkdir ${REMOTE_DIR}; \
51 mkdir testrepo; cd testrepo; \
53 echo moi > _darcs/prefs/author; \
54 touch a; darcs add a; darcs record a --ignore-times -am 'add file a'; \
55 echo 'first line' > a; darcs record a --ignore-times -am 'add first line to a'; \
58 darcs get testrepo testrepo-pull; \
60 echo moi > _darcs/prefs/author; \
61 touch b; darcs add b; darcs record b --ignore-times -am 'add file b'; \
62 echo 'other line' > b; darcs record b --ignore-times -am 'add other line to b'; \
65 darcs get testrepo testrepo-push; \
66 darcs get testrepo testrepo-send; \
69 # ================ Settings ===============
70 echo ${DARCS_SSH_FLAGS}
75 # ================ Checking darcs get ==================
76 ${DARCS} get ${DARCS_SSH_FLAGS} ${REMOTE}:${REMOTE_DIR}/testrepo ${DARCS_SSH_FLAGS}
77 # check that the test repo made it over
79 [ -d testrepo
/_darcs
]
82 # if the above test is disabled we just init a blank repo
83 # so that the other tests can continue
84 if [ ! -d testrepo
]; then
91 # ================ Checking darcs pull =================
92 ${DARCS} get
${DARCS_SSH_FLAGS} testrepo testrepo-pull
94 echo yy |
${DARCS} pull ${DARCS_SSH_FLAGS} ${REMOTE}:${REMOTE_DIR}/testrepo-pull
95 # see if the changes got pulled over
100 # ================ Checking darcs push and send ================="
101 ${DARCS} get
${DARCS_SSH_FLAGS} testrepo testrepo-push
103 echo moi
> _darcs
/prefs
/author
104 echo "second line" >> a
; ${DARCS} record a
--ignore-times -am "add second line to a"
105 touch c
; ${DARCS} add c
106 ${DARCS} record
--ignore-times -am "add file c" c
107 echo yy |
${DARCS} push ${DARCS_SSH_FLAGS} ${REMOTE}:${REMOTE_DIR}/testrepo-push
108 # check that the file c got pushed over
109 ${SSH} ${REMOTE} "[ -f ${REMOTE_DIR}/testrepo-push
/c
]"
110 echo yy | ${DARCS} send ${DARCS_SSH_FLAGS} ${REMOTE}:${REMOTE_DIR}/testrepo-send -o mybundle.dpatch
111 # check that the bundle was created
112 grep "add
file c
" mybundle.dpatch
115 # ================ Checking darcs put =================="
117 ${DARCS} put ${DARCS_SSH_FLAGS} ${REMOTE}:${REMOTE_DIR}/testrepo-put
118 # check that the put was successful
119 ${SSH} ${REMOTE} "[ -d ${REMOTE_DIR}/testrepo-put
/_darcs
]"
120 ${SSH} ${REMOTE} "[ -f ${REMOTE_DIR}/testrepo-put/a ]"
123 # ======== Checking push over ssh with a conflict ========="
124 ${SSH} ${REMOTE} "echo apply no-allow-conflicts >> ${REMOTE_DIR}/testrepo-put
/_darcs
/prefs
/defaults
"
127 echo 'change for remote' > a
128 darcs record --ignore-times -am 'change for remote'
131 echo 'change for local' > a
132 darcs record --ignore-times -am 'change for local'
134 if darcs push -a 2>&1 | grep -q 'conflicts options to apply' ; then