comparison mercurial/commands.py @ 393:e3f564643888

hg init: add -u flag to update -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg init: add -u flag to update From: Andrew Thompson <andrewkt@aktzero.com> I was trying to get init to run update by passing an option. The basic part works, but if you use the -u option, you have to specify the changeset number, tag, or tip. Anyone see a way to make this work easier? (minor tweaks by mpm) manifest hash: 9e39e822693e1f175cd5e02a8d4a984d82afbd92 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCswJaywK+sNU5EO8RAuILAJ42ZVtnHnlbq/xz6SxhaWLtI4KZ/QCgqS6F 6EDjkfy1F8dmBTf8Ob3ac/s= =f3WC -----END PGP SIGNATURE-----
author mpm@selenic.com
date Fri, 17 Jun 2005 09:03:22 -0800
parents 50aea13227a2
children fbe8834923c5
comparison
equal deleted inserted replaced
392:ee4c80d294e5 393:e3f564643888
352 # tags for multiple parents separated by ' + ' 352 # tags for multiple parents separated by ' + '
353 output.append(' + '.join(parenttags)) 353 output.append(' + '.join(parenttags))
354 354
355 ui.write("%s\n" % ' '.join(output)) 355 ui.write("%s\n" % ' '.join(output))
356 356
357 def init(ui, source=None): 357 def init(ui, source=None, **opts):
358 """create a new repository or copy an existing one""" 358 """create a new repository or copy an existing one"""
359 359
360 if source: 360 if source:
361 paths = {} 361 paths = {}
362 for name, path in ui.configitems("paths"): 362 for name, path in ui.configitems("paths"):
386 repo.addchangegroup(cg) 386 repo.addchangegroup(cg)
387 387
388 f = repo.opener("hgrc", "w") 388 f = repo.opener("hgrc", "w")
389 f.write("[paths]\n") 389 f.write("[paths]\n")
390 f.write("default = %s\n" % source) 390 f.write("default = %s\n" % source)
391
392 if opts['update']:
393 update(ui, repo)
391 else: 394 else:
392 repo = hg.repository(ui, ".", create=1) 395 repo = hg.repository(ui, ".", create=1)
393 396
394 def log(ui, repo, f): 397 def log(ui, repo, f):
395 """show the revision history of a single file""" 398 """show the revision history of a single file"""
628 "forget": (forget, [], "hg forget [files]"), 631 "forget": (forget, [], "hg forget [files]"),
629 "heads": (heads, [], 'hg heads'), 632 "heads": (heads, [], 'hg heads'),
630 "history": (history, [], 'hg history'), 633 "history": (history, [], 'hg history'),
631 "help": (help, [], 'hg help [command]'), 634 "help": (help, [], 'hg help [command]'),
632 "identify|id": (identify, [], 'hg identify'), 635 "identify|id": (identify, [], 'hg identify'),
633 "init": (init, [], 'hg init [url]'), 636 "init": (init, [('u', 'update', None, 'update after init')],
637 'hg init [options] [url]'),
634 "log": (log, [], 'hg log <file>'), 638 "log": (log, [], 'hg log <file>'),
635 "manifest|dumpmanifest": (manifest, [], 'hg manifest [rev]'), 639 "manifest|dumpmanifest": (manifest, [], 'hg manifest [rev]'),
636 "parents": (parents, [], 'hg parents [node]'), 640 "parents": (parents, [], 'hg parents [node]'),
637 "patch|import": (patch, 641 "patch|import": (patch,
638 [('p', 'strip', 1, 'path strip'), 642 [('p', 'strip', 1, 'path strip'),