~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2005-09-11 03:28:31 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20050911032831-7df69b7bdc4cfefd
Added new bzr patch command

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        from fetch_missing import fetch_missing
68
68
        fetch_missing(branch)
69
69
 
 
70
class cmd_patch(bzrlib.commands.Command):
 
71
    """Apply a named patch to the current tree.
 
72
    """
 
73
    takes_args = ['filename?']
 
74
    takes_options = ['strip']
 
75
    def run(self, filename=None, strip=0):
 
76
        from patch import patch
 
77
        from bzrlib.branch import Branch
 
78
        b = Branch('.', find_root=True)
 
79
        return patch(b, filename, strip)
 
80
 
 
81
 
 
82
 
70
83
commands = [push.cmd_push, annotate.cmd_annotate, shelf.cmd_shelve, 
71
84
            shelf.cmd_unshelve, cmd_clean_tree, conflicts.cmd_conflicts,
72
 
            conflicts.cmd_resolve, cmd_graph_ancestry, cmd_fetch_missing]
 
85
            conflicts.cmd_resolve, cmd_graph_ancestry, cmd_fetch_missing,
 
86
            cmd_patch]
73
87
from errors import NoPyBaz
74
88
try:
75
89
    import baz_import