Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 45847:d68618954ade
errors: use InputError for some errors on `hg clone`
Differential Revision: https://phab.mercurial-scm.org/D9329
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 12 Nov 2020 15:28:06 -0800 |
parents | 00402df57db7 |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45846:96ca817ec192 | 45847:d68618954ade |
---|---|
681 | 681 |
682 dest = util.urllocalpath(dest) | 682 dest = util.urllocalpath(dest) |
683 source = util.urllocalpath(source) | 683 source = util.urllocalpath(source) |
684 | 684 |
685 if not dest: | 685 if not dest: |
686 raise error.Abort(_(b"empty destination path is not valid")) | 686 raise error.InputError(_(b"empty destination path is not valid")) |
687 | 687 |
688 destvfs = vfsmod.vfs(dest, expandpath=True) | 688 destvfs = vfsmod.vfs(dest, expandpath=True) |
689 if destvfs.lexists(): | 689 if destvfs.lexists(): |
690 if not destvfs.isdir(): | 690 if not destvfs.isdir(): |
691 raise error.Abort(_(b"destination '%s' already exists") % dest) | 691 raise error.InputError(_(b"destination '%s' already exists") % dest) |
692 elif destvfs.listdir(): | 692 elif destvfs.listdir(): |
693 raise error.Abort(_(b"destination '%s' is not empty") % dest) | 693 raise error.InputError(_(b"destination '%s' is not empty") % dest) |
694 | 694 |
695 createopts = {} | 695 createopts = {} |
696 narrow = False | 696 narrow = False |
697 | 697 |
698 if storeincludepats is not None: | 698 if storeincludepats is not None: |