File: rollback.sh

package info (click to toggle)
darcs 2.18.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,960 kB
  • sloc: haskell: 47,748; sh: 13,466; ansic: 447; perl: 134; makefile: 8
file content (51 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (5)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash

. ./lib

# rollback nothing

rm -rf temp1
darcs init temp1
cd temp1
date > file1
darcs record -lam "test"
rm file1
darcs record -am "rm"
echo yYd | tr [A-Z] [a-z] | darcs rollback --last=1 | grep 'No changes selected'
cd ..
rm -rf temp1

# issue1848 - interactive selection of primitive patches
# should still work with rollback -p

darcs init temp1
cd temp1
echo 'f' > f
echo 'g' > g
darcs record -lam 'Add f and g'
echo ynq | darcs rollback -p 'f and g'
cd ..
rm -rf temp1

# issue2242 - rollback of a mv patch generates bogus changes

darcs init temp1
cd temp1

# Setup dir with empty file in it
mkdir A
touch A/foo
darcs rec -alm 'Add A'

# Mv dir and add content to file
darcs mv A B
echo -e 'line1\nline2' > B/foo
darcs rec -alm 'Move A -> B and change foo'

# Rollback everything in the move/change patch
echo ynya | darcs roll

# We shouldn't see any rm'd dirs/files (just a move and line removal hunk)
darcs wh | not grep rm
cd ..
rm -rf temp1