File: bad-match-pattern.sh

package info (click to toggle)
darcs 2.0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,400 kB
  • ctags: 1,048
  • sloc: haskell: 24,937; perl: 9,736; sh: 3,369; ansic: 1,913; makefile: 17; xml: 14
file content (38 lines) | stat: -rw-r--r-- 811 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash

# This is a test for issue761, which pointed out that we didn't check the
# syntax of --match patterns until after having spent considerable time
# doing considerable work.  So here we construct a very invalid repository,
# and check that darcs fails *before* it notices that it's pulling from a
# bad repository.  Thus we verify that we aren't doing any work prior to
# checking the flags.

set -ev

rm -rf temp1 temp2
mkdir temp1
cd temp1
darcs init
touch foo bar
darcs add foo bar
darcs record -a -m 'add two files'
darcs tag -m tag
rm foo bar
darcs record -a -m 'rm two files'
darcs tag -m tag2

rm -rf _darcs/inventories/*
rm -rf _darcs/patches/*

cd ..

mkdir temp2
cd temp2
darcs init
! darcs pull --match 'foobar' ../temp1 2> error
cat error

grep foobar error

rm -rf temp1 temp2