comparison mercurial/commands.py @ 496:6ce95a04999d

[PATCH] simplify init -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] simplify init From: Bryan O'Sullivan <bos@serpentine.com> Remove source directory option from "hg init". manifest hash: 2ace7b16c962fb434340b937fbcd494f3098a85f -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCwQG/ywK+sNU5EO8RArbCAJ9DG45GepMI0Z9KWXqV8gmEbV1WfwCgotih LGAkD8iTfOLn7HIPVqt9FWY= =65uW -----END PGP SIGNATURE-----
author mpm@selenic.com
date Mon, 27 Jun 2005 23:52:31 -0800
parents e94cebc60d96
children 81c563a254be
comparison
equal deleted inserted replaced
495:e94cebc60d96 496:6ce95a04999d
491 491
492 if len(files) > 0: 492 if len(files) > 0:
493 addremove(ui, repo, *files) 493 addremove(ui, repo, *files)
494 repo.commit(files, text) 494 repo.commit(files, text)
495 495
496 def init(ui, source=None, **opts): 496 def init(ui, source=None):
497 """create a new repository or (deprecated, use clone) copy an existing one""" 497 """create a new repository in the current directory"""
498 498
499 if source: 499 if source:
500 ui.warn("this use of init is deprecated: use \"hg clone\" instead\n") 500 ui.warn("no longer supported: use \"hg clone\" instead\n")
501 opts['no-update'] = not opts['update'] 501 sys.exit(1)
502 clone(ui, source, None, **opts) 502 repo = hg.repository(ui, ".", create=1)
503 else:
504 repo = hg.repository(ui, ".", create=1)
505 503
506 def log(ui, repo, f): 504 def log(ui, repo, f):
507 """show the revision history of a single file""" 505 """show the revision history of a single file"""
508 f = relpath(repo, [f])[0] 506 f = relpath(repo, [f])[0]
509 507
751 "identify|id": (identify, [], 'hg identify'), 749 "identify|id": (identify, [], 'hg identify'),
752 "import|patch": (import_, 750 "import|patch": (import_,
753 [('p', 'strip', 1, 'path strip'), 751 [('p', 'strip', 1, 'path strip'),
754 ('b', 'base', "", 'base path')], 752 ('b', 'base', "", 'base path')],
755 "hg import [options] <patches>"), 753 "hg import [options] <patches>"),
756 "init": (init, [('u', 'update', None, 'update after init')], 754 "init": (init, [], 'hg init'),
757 'hg init [options] [url]'),
758 "log": (log, [], 'hg log <file>'), 755 "log": (log, [], 'hg log <file>'),
759 "manifest": (manifest, [], 'hg manifest [rev]'), 756 "manifest": (manifest, [], 'hg manifest [rev]'),
760 "parents": (parents, [], 'hg parents [node]'), 757 "parents": (parents, [], 'hg parents [node]'),
761 "pull": (pull, 758 "pull": (pull,
762 [('u', 'update', None, 'update working directory')], 759 [('u', 'update', None, 'update working directory')],