comparison hg_delta_editor.py @ 224:2165461d2dd8

Exception clean-ups; use symbolic names & avoid Python 2.6 deprecations.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Thu, 19 Mar 2009 21:27:39 +0100
parents 05243ec295e1
children 2117cb0118fe aacc8cf83e13
comparison
equal deleted inserted replaced
212:a421aca2b0f5 224:2165461d2dd8
506 # Accumulate externals records for all branches 506 # Accumulate externals records for all branches
507 revnum = self.current_rev.revnum 507 revnum = self.current_rev.revnum
508 branches = {} 508 branches = {}
509 for path, entry in self.externals.iteritems(): 509 for path, entry in self.externals.iteritems():
510 if not self._is_path_valid(path): 510 if not self._is_path_valid(path):
511 self.ui.warn('WARNING: Invalid path %s in externals\n' % path)
511 continue 512 continue
512 p, b, bp = self._split_branch_path(path) 513 p, b, bp = self._split_branch_path(path)
513 if bp not in branches: 514 if bp not in branches:
514 external = svnexternals.externalsfile() 515 external = svnexternals.externalsfile()
515 parent = self.get_parent_revision(revnum, b) 516 parent = self.get_parent_revision(revnum, b)
836 baserev = base_revision 837 baserev = base_revision
837 if baserev is None or baserev == -1: 838 if baserev is None or baserev == -1:
838 baserev = self.current_rev.revnum - 1 839 baserev = self.current_rev.revnum - 1
839 parent = self.get_parent_revision(baserev + 1, branch) 840 parent = self.get_parent_revision(baserev + 1, branch)
840 self.load_base_from_ctx(path, fpath, self.repo.changectx(parent)) 841 self.load_base_from_ctx(path, fpath, self.repo.changectx(parent))
842 else:
843 self.ui.warn('WARNING: Opening non-existant file %s\n' % path)
841 open_file = stash_exception_on_self(open_file) 844 open_file = stash_exception_on_self(open_file)
842 845
843 def aresamefiles(self, parentctx, childctx, files): 846 def aresamefiles(self, parentctx, childctx, files):
844 """Assuming all files exist in childctx and parentctx, return True 847 """Assuming all files exist in childctx and parentctx, return True
845 if none of them was changed in-between. 848 if none of them was changed in-between.
1020 handler(window, baton) 1023 handler(window, baton)
1021 # window being None means commit this file 1024 # window being None means commit this file
1022 if not window: 1025 if not window:
1023 self.current_files[self.current_file] = target.getvalue() 1026 self.current_files[self.current_file] = target.getvalue()
1024 except core.SubversionException, e: #pragma: no cover 1027 except core.SubversionException, e: #pragma: no cover
1025 if e.message == 'Delta source ended unexpectedly': 1028 if e.apr_err == core.SVN_ERR_INCOMPLETE_DATA:
1026 self.missing_plaintexts.add(self.current_file) 1029 self.missing_plaintexts.add(self.current_file)
1027 else: #pragma: no cover 1030 else: #pragma: no cover
1028 self._exception_info = sys.exc_info() 1031 raise util.Abort(*e.args)
1029 raise
1030 except: #pragma: no cover 1032 except: #pragma: no cover
1031 print len(base), self.current_file 1033 print len(base), self.current_file
1032 self._exception_info = sys.exc_info() 1034 self._exception_info = sys.exc_info()
1033 raise 1035 raise
1034 return txdelt_window 1036 return txdelt_window