equal
deleted
inserted
replaced
82 |
82 |
83 if narrowspecfile: |
83 if narrowspecfile: |
84 filepath = os.path.join(pycompat.getcwd(), narrowspecfile) |
84 filepath = os.path.join(pycompat.getcwd(), narrowspecfile) |
85 ui.status(_("reading narrowspec from '%s'\n") % filepath) |
85 ui.status(_("reading narrowspec from '%s'\n") % filepath) |
86 try: |
86 try: |
87 fp = open(filepath, 'rb') |
87 fdata = util.readfile(filepath) |
88 except IOError: |
88 except IOError as inst: |
89 raise error.Abort(_("file '%s' not found") % filepath) |
89 raise error.Abort(_("cannot read narrowspecs from '%s': %s") % |
90 |
90 (filepath, encoding.strtolocal(inst.strerror))) |
91 includes, excludes, profiles = sparse.parseconfig(ui, fp.read(), |
91 |
92 'narrow') |
92 includes, excludes, profiles = sparse.parseconfig(ui, fdata, 'narrow') |
93 if profiles: |
93 if profiles: |
94 raise error.Abort(_("cannot specify other files using '%include' in" |
94 raise error.Abort(_("cannot specify other files using '%include' in" |
95 " narrowspec")) |
95 " narrowspec")) |
96 |
96 |
97 # narrowspec is passed so we should assume that user wants narrow clone |
97 # narrowspec is passed so we should assume that user wants narrow clone |