Debian Codegraph @

tests/test-mq-symlinks.t

raw
1 #require symlink
2
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
5
6 $ hg init repo
7 $ cd repo
8 $ hg qinit
9 $ hg qnew base.patch
10 $ echo aaa > a
11 $ echo bbb > b
12 $ echo ccc > c
13 $ hg add a b c
14 $ hg qrefresh
15 $ readlink.py a
16 a -> a not a symlink
17
18
19 test replacing a file with a symlink
20
21 $ hg qnew symlink.patch
22 $ rm a
23 $ ln -s b a
24 $ hg qrefresh --git
25 $ readlink.py a
26 a -> b
27
28 $ hg qpop
29 popping symlink.patch
30 now at: base.patch
31 $ hg qpush
32 applying symlink.patch
33 now at: symlink.patch
34 $ readlink.py a
35 a -> b
36
37
38 test updating a symlink
39
40 $ rm a
41 $ ln -s c a
42 $ hg qnew --git -f updatelink
43 $ readlink.py a
44 a -> c
45 $ hg qpop
46 popping updatelink
47 now at: symlink.patch
48 $ hg qpush --debug
49 applying updatelink
50 patching file a
51 committing files:
52 a
53 committing manifest
54 committing changelog
55 updating the branch cache
56 now at: updatelink
57 $ readlink.py a
58 a -> c
59 $ hg st
60
61
62 test replacing a symlink with a file
63
64 $ ln -s c s
65 $ hg add s
66 $ hg qnew --git -f addlink
67 $ rm s
68 $ echo sss > s
69 $ hg qnew --git -f replacelinkwithfile
70 $ hg qpop
71 popping replacelinkwithfile
72 now at: addlink
73 $ hg qpush
74 applying replacelinkwithfile
75 now at: replacelinkwithfile
76 $ cat s
77 sss
78 $ hg st
79
80
81 test symlink removal
82
83 $ hg qnew removesl.patch
84 $ hg rm a
85 $ hg qrefresh --git
86 $ hg qpop
87 popping removesl.patch
88 now at: replacelinkwithfile
89 $ hg qpush
90 applying removesl.patch
91 now at: removesl.patch
92 $ hg st -c
93 C b
94 C c
95 C s
96
97 replace broken symlink with another broken symlink
98
99 $ ln -s linka linka
100 $ hg add linka
101 $ hg qnew link
102 $ hg mv linka linkb
103 $ rm linkb
104 $ ln -s linkb linkb
105 $ hg qnew movelink
106 $ hg qpop
107 popping movelink
108 now at: link
109 $ hg qpush
110 applying movelink
111 now at: movelink
112 $ readlink.py linkb
113 linkb -> linkb