##// END OF EJS Templates
narrow: use util.readfile() and improve error message using --narrowspec...
Pulkit Goyal -
r39501:4062bbb1 default
parent child Browse files
Show More
@@ -84,12 +84,12 b' def clonenarrowcmd(orig, ui, repo, *args'
84 84 filepath = os.path.join(pycompat.getcwd(), narrowspecfile)
85 85 ui.status(_("reading narrowspec from '%s'\n") % filepath)
86 86 try:
87 fp = open(filepath, 'rb')
88 except IOError:
89 raise error.Abort(_("file '%s' not found") % filepath)
87 fdata = util.readfile(filepath)
88 except IOError as inst:
89 raise error.Abort(_("cannot read narrowspecs from '%s': %s") %
90 (filepath, encoding.strtolocal(inst.strerror)))
90 91
91 includes, excludes, profiles = sparse.parseconfig(ui, fp.read(),
92 'narrow')
92 includes, excludes, profiles = sparse.parseconfig(ui, fdata, 'narrow')
93 93 if profiles:
94 94 raise error.Abort(_("cannot specify other files using '%include' in"
95 95 " narrowspec"))
General Comments 0
You need to be logged in to leave comments. Login now