~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Charlie Shepherd
  • Date: 2007-04-04 18:12:00 UTC
  • mto: This revision was merged to the branch mainline in revision 538.
  • Revision ID: masterdriverz@gentoo.org-20070404181200-wqiwytdor9srux2v
Remove all trailing whitespace

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
from bzrlib.errors import BzrCommandError
82
82
import bzrlib.ignores
83
83
from bzrlib.option import Option
84
 
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 
 
84
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__),
85
85
                                                 "external")))
86
86
 
87
87
import show_paths
104
104
 
105
105
    To check what clean-tree will do, use --dry-run.
106
106
    """
107
 
    takes_options = [Option('ignored', help='delete all ignored files.'), 
 
107
    takes_options = [Option('ignored', help='delete all ignored files.'),
108
108
                     Option('detritus', help='delete conflict files, merge'
109
 
                            ' backups, and failed selftest dirs.'), 
110
 
                     Option('unknown', 
 
109
                            ' backups, and failed selftest dirs.'),
 
110
                     Option('unknown',
111
111
                            help='delete files unknown to bzr.  (default)'),
112
112
                     Option('dry-run', help='show files to delete instead of'
113
113
                            ' deleting them.')]
121
121
 
122
122
class cmd_graph_ancestry(bzrlib.commands.Command):
123
123
    """Produce ancestry graphs using dot.
124
 
    
 
124
 
125
125
    Output format is detected according to file extension.  Some of the more
126
126
    common output formats are html, png, gif, svg, ps.  An extension of '.dot'
127
127
    will cause a dot graph file to be produced.  HTML output has mouseovers
131
131
    with the last 5 characters of their revision identifier are used instead.
132
132
 
133
133
    The value starting with d is "(maximum) distance from the null revision".
134
 
    
 
134
 
135
135
    If --merge-branch is specified, the two branches are compared and a merge
136
136
    base is selected.
137
 
    
 
137
 
138
138
    Legend:
139
139
    white    normal revision
140
140
    yellow   THIS  history
155
155
    be disabled with --no-antialias.
156
156
    """
157
157
    takes_args = ['branch', 'file']
158
 
    takes_options = [Option('no-collapse', help="Do not skip simple nodes"), 
 
158
    takes_options = [Option('no-collapse', help="Do not skip simple nodes"),
159
159
                     Option('no-antialias',
160
 
                     help="Do not use rsvg to produce antialiased output"), 
161
 
                     Option('merge-branch', type=str, 
162
 
                     help="Use this branch to calcuate a merge base"), 
 
160
                     help="Do not use rsvg to produce antialiased output"),
 
161
                     Option('merge-branch', type=str,
 
162
                     help="Use this branch to calcuate a merge base"),
163
163
                     Option('cluster', help="Use clustered output."),
164
164
                     Option('max-distance', help="Show no nodes farther than this",
165
165
                            type=int)]
170
170
            ranking = "cluster"
171
171
        else:
172
172
            ranking = "forced"
173
 
        graph.write_ancestry_file(branch, file, not no_collapse, 
174
 
                                  not no_antialias, merge_branch, ranking, 
 
173
        graph.write_ancestry_file(branch, file, not no_collapse,
 
174
                                  not no_antialias, merge_branch, ranking,
175
175
                                  max_distance=max_distance)
176
176
 
177
177
 
237
237
 
238
238
    takes_args = ['file*']
239
239
    takes_options = ['message', 'revision',
240
 
            Option('all', help='Shelve all changes without prompting'), 
 
240
            Option('all', help='Shelve all changes without prompting'),
241
241
            Option('no-color', help='Never display changes in color')]
242
242
 
243
243
    def run(self, all=False, file_list=None, message=None, revision=None,
417
417
    """
418
418
    takes_args = ["branch?"]
419
419
    def run(self, branch=None):
420
 
        from branchhistory import branch_history 
 
420
        from branchhistory import branch_history
421
421
        return branch_history(branch)
422
422
 
423
423
 
443
443
class cmd_cbranch(bzrlib.commands.Command):
444
444
    """
445
445
    Create a new checkout, associated with a new repository branch.
446
 
    
 
446
 
447
447
    When you cbranch, bzr looks up a target location in locations.conf, and
448
448
    creates the branch there.
449
449
 
453
453
    cbranch_target:policy = appendpath
454
454
 
455
455
    This will mean that if you run "bzr cbranch foo/bar foo/baz" in the
456
 
    working directory root, the branch will be created in 
 
456
    working directory root, the branch will be created in
457
457
    "/branch_root/foo/baz"
458
458
 
459
459
    NOTE: cbranch also supports "cbranch_root", but that behaviour is
460
460
    deprecated.
461
461
    """
462
 
    takes_options = [Option("lightweight", 
 
462
    takes_options = [Option("lightweight",
463
463
                            help="Create a lightweight checkout"), 'revision']
464
464
    takes_args = ["source", "target?"]
465
465
    def run(self, source, target=None, lightweight=False, revision=None):
466
466
        from cbranch import cbranch
467
 
        return cbranch(source, target, lightweight=lightweight, 
 
467
        return cbranch(source, target, lightweight=lightweight,
468
468
                       revision=revision)
469
469
 
470
470
 
478
478
 
479
479
class cmd_multi_pull(bzrlib.commands.Command):
480
480
    """Pull all the branches under a location, e.g. a repository.
481
 
    
 
481
 
482
482
    Both branches present in the directory and the branches of checkouts are
483
483
    pulled.
484
484
    """
536
536
 
537
537
class cmd_import(bzrlib.commands.Command):
538
538
    """Import sources from a directory, tarball or zip file
539
 
    
 
539
 
540
540
    This command will import a directory, tarball or zip file into a bzr
541
541
    tree, replacing any versioned files already present.  If a directory is
542
542
    specified, it is used as the target.  If the directory does not exist, or
547
547
    If the tarball or zip has a single root directory, that directory is
548
548
    stripped when extracting the tarball.  This is not done for directories.
549
549
    """
550
 
    
 
550
 
551
551
    takes_args = ['source', 'tree?']
552
552
    def run(self, source, tree=None):
553
553
        from upstream_import import do_import
577
577
 
578
578
    This command should be used on local archives (or mirrors) only.  It is
579
579
    quite slow on remote archives.
580
 
    
581
 
    reuse_history allows you to specify any previous imports you 
 
580
 
 
581
    reuse_history allows you to specify any previous imports you
582
582
    have done of different archives, which this archive has branches
583
 
    tagged from. This will dramatically reduce the time to convert 
 
583
    tagged from. This will dramatically reduce the time to convert
584
584
    the archive as it will not have to convert the history already
585
585
    converted in that other branch.
586
586
 
600
600
    takes_args = ['to_root_dir', 'from_archive', 'reuse_history*']
601
601
    takes_options = ['verbose', Option('prefixes', type=str,
602
602
                     help="Prefixes of branches to import, colon-separated"),
603
 
                     Option('encoding', type=str, 
 
603
                     Option('encoding', type=str,
604
604
                     help='Force encoding to specified value.  See WARNING.')]
605
605
 
606
606
    def run(self, to_root_dir, from_archive, encoding=None, verbose=False,
626
626
    """
627
627
    takes_args = ['to_location', 'from_branch?', 'reuse_history*']
628
628
    takes_options = ['verbose', Option('max-count', type=int),
629
 
                     Option('encoding', type=str, 
 
629
                     Option('encoding', type=str,
630
630
                     help='Force encoding to specified value.  See WARNING.')]
631
631
 
632
632
    def run(self, to_location, from_branch=None, fast=False, max_count=None,
635
635
        from errors import NoPyBaz
636
636
        try:
637
637
            import baz_import
638
 
            baz_import.baz_import_branch(to_location, from_branch, fast, 
 
638
            baz_import.baz_import_branch(to_location, from_branch, fast,
639
639
                                         max_count, verbose, encoding, dry_run,
640
640
                                         reuse_history_list)
641
641
        except NoPyBaz:
645
645
class cmd_rspush(bzrlib.commands.Command):
646
646
    """Upload this branch to another location using rsync.
647
647
 
648
 
    If no location is specified, the last-used location will be used.  To 
649
 
    prevent dirty trees from being uploaded, rspush will error out if there are 
650
 
    unknown files or local changes.  It will also error out if the upstream 
651
 
    directory is non-empty and not an earlier version of the branch. 
 
648
    If no location is specified, the last-used location will be used.  To
 
649
    prevent dirty trees from being uploaded, rspush will error out if there are
 
650
    unknown files or local changes.  It will also error out if the upstream
 
651
    directory is non-empty and not an earlier version of the branch.
652
652
    """
653
653
    takes_args = ['location?']
654
654
    takes_options = [Option('overwrite', help='Ignore differences between'
660
660
        from bzrlib import workingtree
661
661
        import bzrtools
662
662
        cur_branch = workingtree.WorkingTree.open_containing(".")[0]
663
 
        bzrtools.rspush(cur_branch, location, overwrite=overwrite, 
 
663
        bzrtools.rspush(cur_branch, location, overwrite=overwrite,
664
664
                      working_tree=not no_tree)
665
665
 
666
666
 
680
680
            cmd_branches,
681
681
            cmd_branch_history,
682
682
            cmd_branch_mark,
683
 
            cmd_cbranch,  
 
683
            cmd_cbranch,
684
684
            cmd_cdiff,
685
685
            cmd_clean_tree,
686
686
            cmd_fetch_ghosts,
689
689
            cmd_multi_pull,
690
690
            cmd_patch,
691
691
            cmd_rspush,
692
 
            cmd_shelf, 
 
692
            cmd_shelf,
693
693
            cmd_shell,
694
 
            cmd_shelve, 
 
694
            cmd_shelve,
695
695
            cmd_switch,
696
 
            cmd_unshelve, 
697
 
            cmd_zap,            
 
696
            cmd_unshelve,
 
697
            cmd_zap,
698
698
            ]
699
699
 
700
700