mercurial/commands.py
changeset 496 6ce95a04999d
parent 495 e94cebc60d96
child 499 81c563a254be
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')],