hgext/narrow/narrowcommands.py
changeset 50882 75b90a8eb168
parent 50881 4803cea1e5ab
child 51276 03665fd8ccb9
equal deleted inserted replaced
50881:4803cea1e5ab 50882:75b90a8eb168
   525         raise error.InputError(_(b'the --clear option is not yet supported'))
   525         raise error.InputError(_(b'the --clear option is not yet supported'))
   526 
   526 
   527     # import rules from a file
   527     # import rules from a file
   528     newrules = opts.get('import_rules')
   528     newrules = opts.get('import_rules')
   529     if newrules:
   529     if newrules:
       
   530         filepath = os.path.join(encoding.getcwd(), newrules)
   530         try:
   531         try:
   531             filepath = os.path.join(encoding.getcwd(), newrules)
       
   532             fdata = util.readfile(filepath)
   532             fdata = util.readfile(filepath)
   533         except IOError as inst:
   533         except IOError as inst:
   534             raise error.StorageError(
   534             raise error.StorageError(
   535                 _(b"cannot read narrowspecs from '%s': %s")
   535                 _(b"cannot read narrowspecs from '%s': %s")
   536                 % (filepath, encoding.strtolocal(inst.strerror))
   536                 % (filepath, encoding.strtolocal(inst.strerror))