comparison hgsubversion/layouts/custom.py @ 1555:cff81f35b31e

cleanup: reference Abort from mercurial.error instead of mercurial.util It's been there since hg 1.7 or so, which lets us avoid any need for compat shims.
author Augie Fackler <raf@durin42.com>
date Sat, 24 Mar 2018 16:39:30 -0400
parents 118e6d31b5fc
children
comparison
equal deleted inserted replaced
1554:258fb67fb956 1555:cff81f35b31e
4 Also useful if your layout is pretty normal, but you personally only 4 Also useful if your layout is pretty normal, but you personally only
5 want a couple of branches. 5 want a couple of branches.
6 6
7 7
8 """ 8 """
9 from mercurial import error as hgerror
9 10
10 import base 11 import base
11 12
12 13
13 class CustomLayout(base.BaseLayout): 14 class CustomLayout(base.BaseLayout):
28 svn_path = svn_path.strip('/') 29 svn_path = svn_path.strip('/')
29 30
30 for other_svn in self.svn_to_hg: 31 for other_svn in self.svn_to_hg:
31 if other_svn == svn_path: 32 if other_svn == svn_path:
32 msg = 'specified two hg branches for svn path %s: %s and %s' 33 msg = 'specified two hg branches for svn path %s: %s and %s'
33 raise hgutil.Abort(msg % (svn_path, other_hg, hg_branch)) 34 raise hgerror.Abort(msg % (svn_path, other_hg, hg_branch))
34 35
35 if (other_svn.startswith(svn_path + '/') or 36 if (other_svn.startswith(svn_path + '/') or
36 svn_path.startswith(other_svn + '/')): 37 svn_path.startswith(other_svn + '/')):
37 msg = 'specified mappings for nested svn paths: %s and %s' 38 msg = 'specified mappings for nested svn paths: %s and %s'
38 raise hgutl.Abort(msg % (svn_path, other_svn)) 39 raise hgerror.Abort(msg % (svn_path, other_svn))
39 40
40 self.svn_to_hg[svn_path] = hg_branch 41 self.svn_to_hg[svn_path] = hg_branch
41 self.hg_to_svn[hg_branch] = svn_path 42 self.hg_to_svn[hg_branch] = svn_path
42 43
43 @property 44 @property