##// END OF EJS Templates
cmdutil.commit: use relative paths in the error messages...
Alexis S. L. Carvalho -
r6112:5ffa9627 default
parent child Browse files
Show More
@@ -1133,10 +1133,11 b' def commit(ui, repo, commitfunc, pats, o'
1133 1133 continue
1134 1134 if f not in files:
1135 1135 rf = repo.wjoin(f)
1136 rel = repo.pathto(f)
1136 1137 try:
1137 1138 mode = os.lstat(rf)[stat.ST_MODE]
1138 1139 except OSError:
1139 raise util.Abort(_("file %s not found!") % rf)
1140 raise util.Abort(_("file %s not found!") % rel)
1140 1141 if stat.S_ISDIR(mode):
1141 1142 name = f + '/'
1142 1143 if slist is None:
@@ -1145,12 +1146,12 b' def commit(ui, repo, commitfunc, pats, o'
1145 1146 i = bisect.bisect(slist, name)
1146 1147 if i >= len(slist) or not slist[i].startswith(name):
1147 1148 raise util.Abort(_("no match under directory %s!")
1148 % rf)
1149 % rel)
1149 1150 elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)):
1150 1151 raise util.Abort(_("can't commit %s: "
1151 "unsupported file type!") % rf)
1152 "unsupported file type!") % rel)
1152 1153 elif f not in repo.dirstate:
1153 raise util.Abort(_("file %s not tracked!") % rf)
1154 raise util.Abort(_("file %s not tracked!") % rel)
1154 1155 else:
1155 1156 files = []
1156 1157 try:
@@ -1,10 +1,5 b''
1 1 #!/bin/sh
2 2
3 cleanpath()
4 {
5 sed -e "s:/.*\(/test/.*\):...\1:"
6 }
7
8 3 echo % commit date test
9 4 hg init test
10 5 cd test
@@ -23,8 +18,8 b' echo % commit added file that has been d'
23 18 echo bar > bar
24 19 hg add bar
25 20 rm bar
26 hg commit -d "1000000 0" -m commit-8 2>&1 | cleanpath
27 hg commit -d "1000000 0" -m commit-8 bar 2>&1 | cleanpath
21 hg commit -d "1000000 0" -m commit-8
22 hg commit -d "1000000 0" -m commit-8-2 bar
28 23
29 24 hg -q revert -a --no-backup
30 25
@@ -35,22 +30,22 b" hg -v commit -d '0 0' -m commit-9 dir"
35 30
36 31 echo > dir.file
37 32 hg add
38 hg commit -d '0 0' -m commit-10 dir dir.file 2>&1 | cleanpath
33 hg commit -d '0 0' -m commit-10 dir dir.file
39 34
40 35 echo >> dir/file
41 36 mkdir bleh
42 37 mkdir dir2
43 38 cd bleh
44 hg commit -d '0 0' -m commit-11 . 2>&1 | cleanpath
45 hg commit -d '0 0' -m commit-12 ../dir ../dir2 2>&1 | cleanpath
39 hg commit -d '0 0' -m commit-11 .
40 hg commit -d '0 0' -m commit-12 ../dir ../dir2
46 41 hg -v commit -d '0 0' -m commit-13 ../dir
47 42 cd ..
48 43
49 hg commit -d '0 0' -m commit-14 does-not-exist 2>&1 | cleanpath
44 hg commit -d '0 0' -m commit-14 does-not-exist
50 45 ln -s foo baz
51 hg commit -d '0 0' -m commit-15 baz 2>&1 | cleanpath
46 hg commit -d '0 0' -m commit-15 baz
52 47 touch quux
53 hg commit -d '0 0' -m commit-16 quux 2>&1 | cleanpath
48 hg commit -d '0 0' -m commit-16 quux
54 49 echo >> dir/file
55 50 hg -v commit -d '0 0' -m commit-17 dir/file
56 51 cd ..
@@ -14,18 +14,18 b" abort: invalid date: 'foo bar'"
14 14 nothing changed
15 15 % commit added file that has been deleted
16 16 nothing changed
17 abort: file .../test/bar not found!
17 abort: file bar not found!
18 18 adding dir/file
19 19 dir/file
20 20 adding dir.file
21 abort: no match under directory .../test/dir!
22 abort: no match under directory .../test/bleh!
23 abort: no match under directory .../test/dir2!
21 abort: no match under directory dir!
22 abort: no match under directory .!
23 abort: no match under directory ../dir2!
24 24 dir/file
25 25 does-not-exist: No such file or directory
26 abort: file .../test/does-not-exist not found!
27 abort: file .../test/baz not tracked!
28 abort: file .../test/quux not tracked!
26 abort: file does-not-exist not found!
27 abort: file baz not tracked!
28 abort: file quux not tracked!
29 29 dir/file
30 30 % partial subdir commit test
31 31 adding bar/bar
General Comments 0
You need to be logged in to leave comments. Login now