Remove copy/rename --parents option

This is no longer needed now that we have more standard UNIX-like copy
semantics.
This commit is contained in:
Matt Mackall 2005-10-26 16:32:50 -07:00
parent 980d7b6a6d
commit 5b35150f96
2 changed files with 9 additions and 17 deletions

View File

@ -201,7 +201,6 @@ copy <source ...> <dest>::
-I, --include <pat> include names matching the given patterns
-X, --exclude <pat> exclude names matching the given patterns
-f, --force forcibly copy over an existing managed file
-p, --parents append source path to dest
aliases: cp
@ -493,7 +492,6 @@ rename <source ...> <dest>::
Options:
-A, --after record a rename that has already occurred
-f, --force forcibly copy over an existing managed file
-p, --parents append source path to dest
aliases: mv

View File

@ -788,7 +788,7 @@ def docopy(ui, repo, pats, opts):
pats = list(pats)
dest = pats.pop()
sources = []
dir2dir = not opts['parents'] and len(pats) == 1 and os.path.isdir(pats[0])
dir2dir = len(pats) == 1 and os.path.isdir(pats[0])
def okaytocopy(abs, rel, exact):
reasons = {'?': _('is not managed'),
@ -814,12 +814,10 @@ def docopy(ui, repo, pats, opts):
destisfile = not dir2dir and (len(sources) == 1
or repo.dirstate.state(absdest) != '?')
if destisfile:
if opts['parents']:
raise util.Abort(_('with --parents, destination must be a directory'))
elif len(sources) > 1:
raise util.Abort(_('with multiple sources, destination must be a '
'directory'))
if destisfile and len(sources) > 1:
raise util.Abort(_('with multiple sources, destination must be a '
'directory'))
srcpfxlen = 0
if dir2dir:
srcpfx = util.pathto(cwd, util.canonpath(repo.root, cwd, pats[0]))
@ -831,9 +829,7 @@ def docopy(ui, repo, pats, opts):
errs, copied = 0, []
for abs, rel, exact in sources:
if opts['parents']:
mydest = os.path.join(dest, rel)
elif destisfile:
if destisfile:
mydest = reldest
elif dir2dir:
mydest = os.path.join(dest, rel[srcpfxlen:])
@ -847,7 +843,7 @@ def docopy(ui, repo, pats, opts):
mydestdir = os.path.dirname(myreldest) or '.'
if not opts['after']:
try:
if opts['parents'] or dir2dir: os.makedirs(mydestdir)
if dir2dir: os.makedirs(mydestdir)
elif not destisfile: os.mkdir(mydestdir)
except OSError, inst:
if inst.errno != errno.EEXIST: raise
@ -2213,8 +2209,7 @@ table = {
[('I', 'include', [], _('include names matching the given patterns')),
('X', 'exclude', [], _('exclude names matching the given patterns')),
('A', 'after', None, _('record a copy that has already occurred')),
('f', 'force', None, _('forcibly copy over an existing managed file')),
('p', 'parents', None, _('append source path to dest'))],
('f', 'force', None, _('forcibly copy over an existing managed file'))],
_('hg copy [OPTION]... [SOURCE]... DEST')),
"debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')),
"debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
@ -2336,8 +2331,7 @@ table = {
[('I', 'include', [], _('include names matching the given patterns')),
('X', 'exclude', [], _('exclude names matching the given patterns')),
('A', 'after', None, _('record a rename that has already occurred')),
('f', 'force', None, _('forcibly copy over an existing managed file')),
('p', 'parents', None, _('append source path to dest'))],
('f', 'force', None, _('forcibly copy over an existing managed file'))],
_('hg rename [OPTION]... [SOURCE]... DEST')),
"^revert":
(revert,