##// END OF EJS Templates
mq: fixed ENOENT when qrename to new/directory.patch...
Yuya Nishihara -
r11513:0c944b7a stable
parent child Browse files
Show More
@@ -2311,6 +2311,9 b' def rename(ui, repo, patch, name=None, *'
2311 q.applied[info[0]] = statusentry(info[1], name)
2311 q.applied[info[0]] = statusentry(info[1], name)
2312 q.applied_dirty = 1
2312 q.applied_dirty = 1
2313
2313
2314 destdir = os.path.dirname(absdest)
2315 if not os.path.isdir(destdir):
2316 os.makedirs(destdir)
2314 util.rename(q.join(patch), absdest)
2317 util.rename(q.join(patch), absdest)
2315 r = q.qrepo()
2318 r = q.qrepo()
2316 if r:
2319 if r:
@@ -25,6 +25,12 b' runtest() {'
25
25
26 hg qinit -c
26 hg qinit -c
27
27
28 echo '% qnew with name containing slash'
29 hg qnew foo/bar.patch
30 hg qseries
31 hg qpop
32 hg qdelete foo/bar.patch
33
28 echo '% qnew with uncommitted changes'
34 echo '% qnew with uncommitted changes'
29 echo a > somefile
35 echo a > somefile
30 hg add somefile
36 hg add somefile
@@ -8,6 +8,10 b' abort: ".hgignore" cannot be used as the'
8 abort: ".mqfoo" cannot be used as the name of a patch
8 abort: ".mqfoo" cannot be used as the name of a patch
9 abort: "foo#bar" cannot be used as the name of a patch
9 abort: "foo#bar" cannot be used as the name of a patch
10 abort: "foo:bar" cannot be used as the name of a patch
10 abort: "foo:bar" cannot be used as the name of a patch
11 % qnew with name containing slash
12 foo/bar.patch
13 popping foo/bar.patch
14 patch queue now empty
11 % qnew with uncommitted changes
15 % qnew with uncommitted changes
12 uncommitted.patch
16 uncommitted.patch
13 % qnew implies add
17 % qnew implies add
@@ -58,6 +62,10 b' abort: ".hgignore" cannot be used as the'
58 abort: ".mqfoo" cannot be used as the name of a patch
62 abort: ".mqfoo" cannot be used as the name of a patch
59 abort: "foo#bar" cannot be used as the name of a patch
63 abort: "foo#bar" cannot be used as the name of a patch
60 abort: "foo:bar" cannot be used as the name of a patch
64 abort: "foo:bar" cannot be used as the name of a patch
65 % qnew with name containing slash
66 foo/bar.patch
67 popping foo/bar.patch
68 patch queue now empty
61 % qnew with uncommitted changes
69 % qnew with uncommitted changes
62 uncommitted.patch
70 uncommitted.patch
63 % qnew implies add
71 % qnew implies add
@@ -22,6 +22,9 b' ls .hg/patches/bar'
22 hg qrename bar/renamed baz
22 hg qrename bar/renamed baz
23 hg qseries
23 hg qseries
24 ls .hg/patches/baz
24 ls .hg/patches/baz
25 hg qrename baz new/dir
26 hg qseries
27 ls .hg/patches/new/dir
25 cd ..
28 cd ..
26
29
27 echo % test patch being renamed before committed
30 echo % test patch being renamed before committed
@@ -5,4 +5,6 b' bar/renamed'
5 renamed
5 renamed
6 baz
6 baz
7 .hg/patches/baz
7 .hg/patches/baz
8 new/dir
9 .hg/patches/new/dir
8 % test patch being renamed before committed
10 % test patch being renamed before committed
General Comments 0
You need to be logged in to leave comments. Login now