Mercurial > hgsubversion
comparison hg_delta_editor.py @ 197:43d56e973c3c
Replace a few asserts with aborts.
| author | Dan Villiom Podlaski Christiansen <danchr@cs.au.dk> |
|---|---|
| date | Thu, 12 Feb 2009 15:08:53 +0100 |
| parents | 6266ba36ee15 |
| children | df4611050286 |
comparison
equal
deleted
inserted
replaced
| 196:77812f98e250 | 197:43d56e973c3c |
|---|---|
| 537 parent_ctx = self.repo.changectx(ha) | 537 parent_ctx = self.repo.changectx(ha) |
| 538 def del_all_files(*args): | 538 def del_all_files(*args): |
| 539 raise IOError | 539 raise IOError |
| 540 # True here meant nuke all files, shouldn't happen with branch closing | 540 # True here meant nuke all files, shouldn't happen with branch closing |
| 541 if self.commit_branches_empty[branch]: #pragma: no cover | 541 if self.commit_branches_empty[branch]: #pragma: no cover |
| 542 assert False, 'Got asked to commit non-closed branch as empty with no files. Please report this issue.' | 542 raise util.Abort('Empty commit to an open branch attempted. ' |
| 543 'Please report this issue.') | |
| 543 extra = our_util.build_extra(rev.revnum, branch, | 544 extra = our_util.build_extra(rev.revnum, branch, |
| 544 open(self.uuid_file).read(), | 545 open(self.uuid_file).read(), |
| 545 self.subdir) | 546 self.subdir) |
| 546 current_ctx = context.memctx(self.repo, | 547 current_ctx = context.memctx(self.repo, |
| 547 (ha, node.nullid), | 548 (ha, node.nullid), |
| 885 target = cStringIO.StringIO() | 886 target = cStringIO.StringIO() |
| 886 self.stream = target | 887 self.stream = target |
| 887 | 888 |
| 888 handler, baton = delta.svn_txdelta_apply(source, target, None) | 889 handler, baton = delta.svn_txdelta_apply(source, target, None) |
| 889 if not callable(handler): #pragma: no cover | 890 if not callable(handler): #pragma: no cover |
| 890 # TODO(augie) Raise a real exception, don't just fail an assertion. | 891 raise util.Abort('Error in Subversion bindings: ' |
| 891 assert False, 'handler not callable, bindings are broken' | 892 'cannot call handler!') |
| 892 def txdelt_window(window): | 893 def txdelt_window(window): |
| 893 try: | 894 try: |
| 894 if not self._is_path_valid(self.current_file): | 895 if not self._is_path_valid(self.current_file): |
| 895 return | 896 return |
| 896 handler(window, baton) | 897 handler(window, baton) |
