[PATCH] simplify init
authormpm@selenic.com
Mon, 27 Jun 2005 23:52:31 -0800
changeset 496 6ce95a04999d
parent 495 e94cebc60d96
child 497 2dcced388cab
[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-----
doc/hg.1.txt
mercurial/commands.py
tests/test-help.out
--- a/doc/hg.1.txt	Mon Jun 27 22:29:44 2005 -0800
+++ b/doc/hg.1.txt	Mon Jun 27 23:52:31 2005 -0800
@@ -149,22 +149,8 @@
 
     aliases: patch
 
-init [-u] [source]::
-    Initialize a repository in the current directory.
-
-    NOTE: The following use is deprecated, and will be removed soon;
-    use the "hg clone" command instead.
-
-    If a source is specified, pull that source into the repository.
-    This source is added to .hg/hgrc as the default for future pulls
-    in this repository.
-
-    If the specified source is on the same filesystem, the repository
-    will be copied via hardlinks. This is the fastest and most
-    space-efficient mode of operation.
-
-    options:
-    -u, --update   update the working directory to match the tip
+init::
+    Initialize a new repository in the current directory.
 
 log <file>::
     Print the revision history of the specified file.
--- a/mercurial/commands.py	Mon Jun 27 22:29:44 2005 -0800
+++ b/mercurial/commands.py	Mon Jun 27 23:52:31 2005 -0800
@@ -493,15 +493,13 @@
             addremove(ui, repo, *files)
         repo.commit(files, text)
 
-def init(ui, source=None, **opts):
-    """create a new repository or (deprecated, use clone) copy an existing one"""
+def init(ui, source=None):
+    """create a new repository in the current directory"""
 
     if source:
-        ui.warn("this use of init is deprecated: use \"hg clone\" instead\n")
-        opts['no-update'] = not opts['update']
-        clone(ui, source, None, **opts)
-    else:
-        repo = hg.repository(ui, ".", create=1)
+        ui.warn("no longer supported: use \"hg clone\" instead\n")
+        sys.exit(1)
+    repo = hg.repository(ui, ".", create=1)
 
 def log(ui, repo, f):
     """show the revision history of a single file"""
@@ -753,8 +751,7 @@
                      [('p', 'strip', 1, 'path strip'),
                       ('b', 'base', "", 'base path')],
                      "hg import [options] <patches>"),
-    "init": (init, [('u', 'update', None, 'update after init')],
-             'hg init [options] [url]'),
+    "init": (init, [], 'hg init'),
     "log": (log, [], 'hg log <file>'),
     "manifest": (manifest, [], 'hg manifest [rev]'),
     "parents": (parents, [], 'hg parents [node]'),
--- a/tests/test-help.out	Mon Jun 27 22:29:44 2005 -0800
+++ b/tests/test-help.out	Mon Jun 27 23:52:31 2005 -0800
@@ -16,7 +16,7 @@
  history     show the changelog history
  identify    print information about the working copy
  import      import an ordered set of patches
- init        create a new repository or (deprecated, use clone) copy an existing one
+ init        create a new repository in the current directory
  log         show the revision history of a single file
  manifest    output the latest or given revision of the project manifest
  parents     show the parents of the current working dir
@@ -68,7 +68,7 @@
  history     show the changelog history
  identify    print information about the working copy
  import      import an ordered set of patches
- init        create a new repository or (deprecated, use clone) copy an existing one
+ init        create a new repository in the current directory
  log         show the revision history of a single file
  manifest    output the latest or given revision of the project manifest
  parents     show the parents of the current working dir