##// 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 197 aliases: patch
198 198
199 init::
200 Initialize a new repository in the current directory.
199 init [dest]::
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 205 locate [options] [files]::
203 206 Print all files under Mercurial control whose names match the
@@ -772,12 +772,11 b' def import_(ui, repo, patch1, *patches, '
772 772 addremove(ui, repo, *files)
773 773 repo.commit(files, message, user)
774 774
775 def init(ui, source=None):
776 """create a new repository in the current directory"""
777
778 if source:
779 raise util.Abort("no longer supported: use \"hg clone\" instead")
780 hg.repository(ui, ".", create=1)
775 def init(ui, dest="."):
776 """create a new repository in the given directory"""
777 if not os.path.exists(dest):
778 os.mkdir(dest)
779 hg.repository(ui, dest, create=1)
781 780
782 781 def locate(ui, repo, *pats, **opts):
783 782 """locate files matching specific patterns"""
@@ -1279,7 +1278,7 b' table = {'
1279 1278 [('p', 'strip', 1, 'path strip'),
1280 1279 ('b', 'base', "", 'base path')],
1281 1280 "hg import [-p NUM] [-b BASE] PATCH..."),
1282 "^init": (init, [], 'hg init'),
1281 "^init": (init, [], 'hg init [DEST]'),
1283 1282 "locate":
1284 1283 (locate,
1285 1284 [('r', 'rev', '', 'revision'),
General Comments 0
You need to be logged in to leave comments. Login now