comparison mercurial/commands.py @ 6171:73b1de288801

Add --all option to bundle command
author John Mulligan <phlogistonjohn@yahoo.com>
date Thu, 21 Feb 2008 08:24:58 -0500
parents 1f733c2f0165
children 81afdd016867
comparison
equal deleted inserted replaced
6170:747169c54c68 6171:73b1de288801
396 """create a changegroup file 396 """create a changegroup file
397 397
398 Generate a compressed changegroup file collecting changesets not 398 Generate a compressed changegroup file collecting changesets not
399 found in the other repository. 399 found in the other repository.
400 400
401 If no destination repository is specified the destination is assumed 401 If no destination repository is specified the destination is
402 to have all the nodes specified by one or more --base parameters. 402 assumed to have all the nodes specified by one or more --base
403 To create a bundle containing all changesets, use --base null. 403 parameters. To create a bundle containing all changesets, use
404 --all (or --base null).
404 405
405 The bundle file can then be transferred using conventional means and 406 The bundle file can then be transferred using conventional means and
406 applied to another repository with the unbundle or pull command. 407 applied to another repository with the unbundle or pull command.
407 This is useful when direct push and pull are not available or when 408 This is useful when direct push and pull are not available or when
408 exporting an entire repository is undesirable. 409 exporting an entire repository is undesirable.
411 permissions, copy/rename information, and revision history. 412 permissions, copy/rename information, and revision history.
412 """ 413 """
413 revs = opts.get('rev') or None 414 revs = opts.get('rev') or None
414 if revs: 415 if revs:
415 revs = [repo.lookup(rev) for rev in revs] 416 revs = [repo.lookup(rev) for rev in revs]
416 base = opts.get('base') 417 if opts.get('all'):
418 base = ['null']
419 else:
420 base = opts.get('base')
417 if base: 421 if base:
418 if dest: 422 if dest:
419 raise util.Abort(_("--base is incompatible with specifiying " 423 raise util.Abort(_("--base is incompatible with specifiying "
420 "a destination")) 424 "a destination"))
421 base = [repo.lookup(rev) for rev in base] 425 base = [repo.lookup(rev) for rev in base]
2810 _('run even when remote repository is unrelated')), 2814 _('run even when remote repository is unrelated')),
2811 ('r', 'rev', [], 2815 ('r', 'rev', [],
2812 _('a changeset you would like to bundle')), 2816 _('a changeset you would like to bundle')),
2813 ('', 'base', [], 2817 ('', 'base', [],
2814 _('a base changeset to specify instead of a destination')), 2818 _('a base changeset to specify instead of a destination')),
2819 ('a', 'all', None,
2820 _('bundle all changesets in the repository')),
2815 ] + remoteopts, 2821 ] + remoteopts,
2816 _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')), 2822 _('hg bundle [-f] [-a] [-r REV]... [--base REV]... FILE [DEST]')),
2817 "cat": 2823 "cat":
2818 (cat, 2824 (cat,
2819 [('o', 'output', '', _('print output to file with formatted name')), 2825 [('o', 'output', '', _('print output to file with formatted name')),
2820 ('r', 'rev', '', _('print the given revision')), 2826 ('r', 'rev', '', _('print the given revision')),
2821 ('', 'decode', None, _('apply any matching decode filter')), 2827 ('', 'decode', None, _('apply any matching decode filter')),