comparison hgsubversion/svncommands.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 180e0d5fba2e
children ae572c9be4e6
comparison
equal deleted inserted replaced
1554:258fb67fb956 1555:cff81f35b31e
49 validateuuid = False 49 validateuuid = False
50 if len(args) == 1: 50 if len(args) == 1:
51 dest = args[0] 51 dest = args[0]
52 validateuuid = True 52 validateuuid = True
53 elif len(args) > 1: 53 elif len(args) > 1:
54 raise hgutil.Abort('rebuildmeta takes 1 or no arguments') 54 raise error.Abort('rebuildmeta takes 1 or no arguments')
55 url = repo.ui.expandpath(dest or repo.ui.config('paths', 'default-push') or 55 url = repo.ui.expandpath(dest or repo.ui.config('paths', 'default-push') or
56 repo.ui.config('paths', 'default') or '') 56 repo.ui.config('paths', 'default') or '')
57 57
58 meta = svnmeta.SVNMeta(repo, skiperrorcheck=True) 58 meta = svnmeta.SVNMeta(repo, skiperrorcheck=True)
59 59
194 uuid = convinfo[4:40] 194 uuid = convinfo[4:40]
195 if not skipuuid: 195 if not skipuuid:
196 if svn is None: 196 if svn is None:
197 svn = svnrepo.svnremoterepo(ui, url).svn 197 svn = svnrepo.svnremoterepo(ui, url).svn
198 if uuid != svn.uuid: 198 if uuid != svn.uuid:
199 raise hgutil.Abort('remote svn repository identifier ' 199 raise error.Abort('remote svn repository identifier '
200 'does not match') 200 'does not match')
201 meta.uuid = uuid 201 meta.uuid = uuid
202 202
203 # don't reflect closed branches 203 # don't reflect closed branches
204 if (ctx.extra().get('close') and not ctx.files() or 204 if (ctx.extra().get('close') and not ctx.files() or
341 raise error.RepoError("There is no Mercurial repository" 341 raise error.RepoError("There is no Mercurial repository"
342 " here (.hg not found)") 342 " here (.hg not found)")
343 343
344 ignpath = repo.wvfs.join('.hgignore') 344 ignpath = repo.wvfs.join('.hgignore')
345 if not force and os.path.exists(ignpath): 345 if not force and os.path.exists(ignpath):
346 raise hgutil.Abort('not overwriting existing .hgignore, try --force?') 346 raise error.Abort('not overwriting existing .hgignore, try --force?')
347 svn = svnrepo.svnremoterepo(repo.ui).svn 347 svn = svnrepo.svnremoterepo(repo.ui).svn
348 meta = repo.svnmeta() 348 meta = repo.svnmeta()
349 hashes = meta.revmap.hashes() 349 hashes = meta.revmap.hashes()
350 parent = util.parentrev(ui, repo, meta, hashes) 350 parent = util.parentrev(ui, repo, meta, hashes)
351 r, br = hashes[parent.node()] 351 r, br = hashes[parent.node()]
468 468
469 try: 469 try:
470 commandfunc = table[subcommand] 470 commandfunc = table[subcommand]
471 return commandfunc(ui, args=args, repo=repo, **opts) 471 return commandfunc(ui, args=args, repo=repo, **opts)
472 except svnwrap.SubversionConnectionException, e: 472 except svnwrap.SubversionConnectionException, e:
473 raise hgutil.Abort(*e.args) 473 raise error.Abort(*e.args)
474 except TypeError: 474 except TypeError:
475 tb = traceback.extract_tb(sys.exc_info()[2]) 475 tb = traceback.extract_tb(sys.exc_info()[2])
476 if len(tb) == 1: 476 if len(tb) == 1:
477 ui.status('Bad arguments for subcommand %s\n' % subcommand) 477 ui.status('Bad arguments for subcommand %s\n' % subcommand)
478 else: 478 else: