##// END OF EJS Templates
Modify init command to take an optional directory to set up....
Bryan O'Sullivan -
r907:652507dc default
parent child Browse files
Show More
@@ -196,8 +196,11 b' import [-p <n> -b <base> -q] <patches>::'
196
196
197 aliases: patch
197 aliases: patch
198
198
199 init::
199 init [dest]::
200 Initialize a new repository in the current directory.
200 Initialize a new repository in the given directory. If the given
201 directory does not exist, it is created.
202
203 If no directory is given, the current directory is used.
201
204
202 locate [options] [files]::
205 locate [options] [files]::
203 Print all files under Mercurial control whose names match the
206 Print all files under Mercurial control whose names match the
@@ -772,12 +772,11 b' def import_(ui, repo, patch1, *patches, '
772 addremove(ui, repo, *files)
772 addremove(ui, repo, *files)
773 repo.commit(files, message, user)
773 repo.commit(files, message, user)
774
774
775 def init(ui, source=None):
775 def init(ui, dest="."):
776 """create a new repository in the current directory"""
776 """create a new repository in the given directory"""
777
777 if not os.path.exists(dest):
778 if source:
778 os.mkdir(dest)
779 raise util.Abort("no longer supported: use \"hg clone\" instead")
779 hg.repository(ui, dest, create=1)
780 hg.repository(ui, ".", create=1)
781
780
782 def locate(ui, repo, *pats, **opts):
781 def locate(ui, repo, *pats, **opts):
783 """locate files matching specific patterns"""
782 """locate files matching specific patterns"""
@@ -1279,7 +1278,7 b' table = {'
1279 [('p', 'strip', 1, 'path strip'),
1278 [('p', 'strip', 1, 'path strip'),
1280 ('b', 'base', "", 'base path')],
1279 ('b', 'base', "", 'base path')],
1281 "hg import [-p NUM] [-b BASE] PATCH..."),
1280 "hg import [-p NUM] [-b BASE] PATCH..."),
1282 "^init": (init, [], 'hg init'),
1281 "^init": (init, [], 'hg init [DEST]'),
1283 "locate":
1282 "locate":
1284 (locate,
1283 (locate,
1285 [('r', 'rev', '', 'revision'),
1284 [('r', 'rev', '', 'revision'),
General Comments 0
You need to be logged in to leave comments. Login now