Mercurial > hg
comparison mercurial/wireproto.py @ 11619:48667abddd60
protocol: use return shortcut instead of respond function
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Fri, 16 Jul 2010 19:02:30 +0200 |
parents | 83070a9cd526 |
children | 86b49e0083a7 |
comparison
equal
deleted
inserted
replaced
11618:83070a9cd526 | 11619:48667abddd60 |
---|---|
227 heads = repo.heads() | 227 heads = repo.heads() |
228 return their_heads == ['force'] or their_heads == heads | 228 return their_heads == ['force'] or their_heads == heads |
229 | 229 |
230 # fail early if possible | 230 # fail early if possible |
231 if not check_heads(): | 231 if not check_heads(): |
232 repo.respond(_('unsynced changes')) | 232 return _('unsynced changes') |
233 return | |
234 | 233 |
235 # write bundle data to temporary file because it can be big | 234 # write bundle data to temporary file because it can be big |
236 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') | 235 fd, tempname = tempfile.mkstemp(prefix='hg-unbundle-') |
237 fp = os.fdopen(fd, 'wb+') | 236 fp = os.fdopen(fd, 'wb+') |
238 r = 0 | 237 r = 0 |
242 lock = repo.lock() | 241 lock = repo.lock() |
243 try: | 242 try: |
244 if not check_heads(): | 243 if not check_heads(): |
245 # someone else committed/pushed/unbundled while we | 244 # someone else committed/pushed/unbundled while we |
246 # were transferring data | 245 # were transferring data |
247 proto.respond(_('unsynced changes')) | 246 return _('unsynced changes') |
248 return | |
249 | 247 |
250 # push can proceed | 248 # push can proceed |
251 fp.seek(0) | 249 fp.seek(0) |
252 header = fp.read(6) | 250 header = fp.read(6) |
253 if header.startswith('HG'): | 251 if header.startswith('HG'): |