equal
deleted
inserted
replaced
113 err = e |
113 err = e |
114 status = -1 |
114 status = -1 |
115 |
115 |
116 # In all cases we try to flush stdio streams. |
116 # In all cases we try to flush stdio streams. |
117 if util.safehasattr(req.ui, b'fout'): |
117 if util.safehasattr(req.ui, b'fout'): |
|
118 assert req.ui is not None # help pytype |
|
119 assert req.ui.fout is not None # help pytype |
118 try: |
120 try: |
119 req.ui.fout.flush() |
121 req.ui.fout.flush() |
120 except IOError as e: |
122 except IOError as e: |
121 err = e |
123 err = e |
122 status = -1 |
124 status = -1 |
123 |
125 |
124 if util.safehasattr(req.ui, b'ferr'): |
126 if util.safehasattr(req.ui, b'ferr'): |
|
127 assert req.ui is not None # help pytype |
|
128 assert req.ui.ferr is not None # help pytype |
125 try: |
129 try: |
126 if err is not None and err.errno != errno.EPIPE: |
130 if err is not None and err.errno != errno.EPIPE: |
127 req.ui.ferr.write( |
131 req.ui.ferr.write( |
128 b'abort: %s\n' % encoding.strtolocal(err.strerror) |
132 b'abort: %s\n' % encoding.strtolocal(err.strerror) |
129 ) |
133 ) |
1106 elif not cmd: |
1110 elif not cmd: |
1107 return commands.help_(ui, b'shortlist') |
1111 return commands.help_(ui, b'shortlist') |
1108 |
1112 |
1109 repo = None |
1113 repo = None |
1110 cmdpats = args[:] |
1114 cmdpats = args[:] |
|
1115 assert func is not None # help out pytype |
1111 if not func.norepo: |
1116 if not func.norepo: |
1112 # use the repo from the request only if we don't have -R |
1117 # use the repo from the request only if we don't have -R |
1113 if not rpath and not cwd: |
1118 if not rpath and not cwd: |
1114 repo = req.repo |
1119 repo = req.repo |
1115 |
1120 |