comparison mercurial/cmdutil.py @ 6112:5ffa962783c4

cmdutil.commit: use relative paths in the error messages This is more consistent with other error messages and requires less makeup in test-commit and test-symlink-basic.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 15 Feb 2008 10:38:37 -0200
parents 9f1e6ab76069
children 989467e8e3a9
comparison
equal deleted inserted replaced
6111:213ea6eed412 6112:5ffa962783c4
1131 for f in fns: 1131 for f in fns:
1132 if f == '.': 1132 if f == '.':
1133 continue 1133 continue
1134 if f not in files: 1134 if f not in files:
1135 rf = repo.wjoin(f) 1135 rf = repo.wjoin(f)
1136 rel = repo.pathto(f)
1136 try: 1137 try:
1137 mode = os.lstat(rf)[stat.ST_MODE] 1138 mode = os.lstat(rf)[stat.ST_MODE]
1138 except OSError: 1139 except OSError:
1139 raise util.Abort(_("file %s not found!") % rf) 1140 raise util.Abort(_("file %s not found!") % rel)
1140 if stat.S_ISDIR(mode): 1141 if stat.S_ISDIR(mode):
1141 name = f + '/' 1142 name = f + '/'
1142 if slist is None: 1143 if slist is None:
1143 slist = list(files) 1144 slist = list(files)
1144 slist.sort() 1145 slist.sort()
1145 i = bisect.bisect(slist, name) 1146 i = bisect.bisect(slist, name)
1146 if i >= len(slist) or not slist[i].startswith(name): 1147 if i >= len(slist) or not slist[i].startswith(name):
1147 raise util.Abort(_("no match under directory %s!") 1148 raise util.Abort(_("no match under directory %s!")
1148 % rf) 1149 % rel)
1149 elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)): 1150 elif not (stat.S_ISREG(mode) or stat.S_ISLNK(mode)):
1150 raise util.Abort(_("can't commit %s: " 1151 raise util.Abort(_("can't commit %s: "
1151 "unsupported file type!") % rf) 1152 "unsupported file type!") % rel)
1152 elif f not in repo.dirstate: 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 else: 1155 else:
1155 files = [] 1156 files = []
1156 try: 1157 try:
1157 return commitfunc(ui, repo, files, message, match, opts) 1158 return commitfunc(ui, repo, files, message, match, opts)
1158 except ValueError, inst: 1159 except ValueError, inst: