# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1234447733 -3600 # Node ID 43d56e973c3cb8cfff9eb30295dc652350551955 # Parent 77812f98e250e67ba1928bbe5c49fa53e9ba3fde Replace a few asserts with aborts. diff --git a/fetch_command.py b/fetch_command.py --- a/fetch_command.py +++ b/fetch_command.py @@ -63,6 +63,10 @@ def fetch_revisions(ui, svn_url, hg_repo initializing_repo = True start = skipto_rev + if initializing_repo and start > 0: + raise merc_util.Abort('Revision skipping at repository initialization ' + 'remains unimplemented.') + # start converting revisions for r in svn.revisions(start=start): valid = False @@ -71,8 +75,6 @@ def fetch_revisions(ui, svn_url, hg_repo if hg_editor._is_path_valid(p): valid = True break - if initializing_repo and start > 0: - assert False, 'This feature not ready yet.' if valid: # got a 502? Try more than once! tries = 0 diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- a/hg_delta_editor.py +++ b/hg_delta_editor.py @@ -539,7 +539,8 @@ class HgChangeReceiver(delta.Editor): raise IOError # True here meant nuke all files, shouldn't happen with branch closing if self.commit_branches_empty[branch]: #pragma: no cover - assert False, 'Got asked to commit non-closed branch as empty with no files. Please report this issue.' + raise util.Abort('Empty commit to an open branch attempted. ' + 'Please report this issue.') extra = our_util.build_extra(rev.revnum, branch, open(self.uuid_file).read(), self.subdir) @@ -887,8 +888,8 @@ class HgChangeReceiver(delta.Editor): handler, baton = delta.svn_txdelta_apply(source, target, None) if not callable(handler): #pragma: no cover - # TODO(augie) Raise a real exception, don't just fail an assertion. - assert False, 'handler not callable, bindings are broken' + raise util.Abort('Error in Subversion bindings: ' + 'cannot call handler!') def txdelt_window(window): try: if not self._is_path_valid(self.current_file):