File: test-rebase-rename

package info (click to toggle)
mercurial 1.6.4-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 17,928 kB
  • ctags: 6,062
  • sloc: python: 44,238; sh: 20,985; tcl: 3,578; ansic: 2,557; lisp: 1,412; makefile: 176; xml: 15
file content (55 lines) | stat: -rwxr-xr-x 1,026 bytes parent folder | download | duplicates (2)
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
52
53
54
55
#!/bin/sh

. $TESTDIR/helpers.sh

echo "[extensions]" >> $HGRCPATH
echo "rebase=" >> $HGRCPATH
echo "[diff]" >> $HGRCPATH
echo "git=1" >> $HGRCPATH

BASE=`pwd`

hg init repo1
cd repo1
echo "a">a
hg commit -Am "A" --date '0 0'
echo "b"> b
hg commit -Am "B" --date '1 0'
hg up -C 0
hg mv a a-renamed
hg commit -m 'rename A' --date '2 0'

echo
echo '% Rename is tracked'
hg log -p -r tip --template '{rev}:{desc}\n'

echo '% Rebase the revision containing the rename'
hg rebase -s 2 -d 1 --quiet | cleanrebase

echo
echo '% Rename is not lost'
hg log -p -r tip --template '{rev}:{desc}\n'

cd $BASE
rm -rf repo1
hg init repo1
cd repo1
echo "a">a
hg commit -Am "A" --date '0 0'
echo "b"> b
hg commit -Am "B" --date '1 0'
hg up -C 0
hg cp a a-copied
hg commit -m 'copy A' --date '2 0'

echo
echo '% Copy is tracked'
hg log -p -r tip --template '{rev}:{desc}\n'

echo '% Rebase the revision containing the copy'
hg rebase -s 2 -d 1 --quiet | cleanrebase

echo
echo '% Copy is not lost'
hg log -p -r tip --template '{rev}:{desc}\n'