##// END OF EJS Templates
hgweb: use a single-element tuple to return from protocol.unbundle()...
Dirkjan Ochtman -
r6788:88a1bcc5 default
parent child Browse files
Show More
@@ -124,8 +124,7 b' def unbundle(repo, req):'
124 # response when run outside cgi script
124 # response when run outside cgi script
125 pass
125 pass
126 req.respond(HTTP_OK, HGTYPE)
126 req.respond(HTTP_OK, HGTYPE)
127 yield errorfmt % 'unsynced changes'
127 return errorfmt % 'unsynced changes',
128 return
129
128
130 req.respond(HTTP_OK, HGTYPE)
129 req.respond(HTTP_OK, HGTYPE)
131
130
@@ -143,8 +142,7 b' def unbundle(repo, req):'
143 lock = repo.lock()
142 lock = repo.lock()
144 try:
143 try:
145 if not check_heads():
144 if not check_heads():
146 yield errorfmt % 'unsynced changes'
145 return errorfmt % 'unsynced changes',
147 return
148
146
149 fp.seek(0)
147 fp.seek(0)
150 header = fp.read(6)
148 header = fp.read(6)
@@ -170,11 +168,11 b' def unbundle(repo, req):'
170 finally:
168 finally:
171 val = sys.stdout.getvalue()
169 val = sys.stdout.getvalue()
172 sys.stdout, sys.stderr = oldio
170 sys.stdout, sys.stderr = oldio
173 yield '%d\n%s' % (ret, val)
171 return '%d\n%s' % (ret, val),
174 finally:
172 finally:
175 del lock
173 del lock
176 except ValueError, inst:
174 except ValueError, inst:
177 yield errorfmt % inst
175 return errorfmt % inst,
178 except (OSError, IOError), inst:
176 except (OSError, IOError), inst:
179 filename = getattr(inst, 'filename', '')
177 filename = getattr(inst, 'filename', '')
180 # Don't send our filesystem layout to the client
178 # Don't send our filesystem layout to the client
@@ -188,7 +186,7 b' def unbundle(repo, req):'
188 else:
186 else:
189 code = HTTP_SERVER_ERROR
187 code = HTTP_SERVER_ERROR
190 req.respond(code)
188 req.respond(code)
191 yield '0\n%s: %s\n' % (error, filename)
189 return '0\n%s: %s\n' % (error, filename),
192 finally:
190 finally:
193 fp.close()
191 fp.close()
194 os.unlink(tempname)
192 os.unlink(tempname)
General Comments 0
You need to be logged in to leave comments. Login now