~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-03-16 05:48:38 UTC
  • mfrom: (321.2.5 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20060316054838-a59dfe944c17b493
Got push working with new-format branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
strip_help="""Strip the smallest prefix containing num leading slashes  from \
100
100
each file name found in the patch file."""
101
101
Option.OPTIONS['strip'] = Option('strip', type=int, help=strip_help)
 
102
Option.OPTIONS['bzrdiff'] = Option('bzrdiff',type=None,
 
103
                                help="""Handle extra bzr tags""")
102
104
class cmd_patch(bzrlib.commands.Command):
103
105
    """Apply a named patch to the current tree.
104
106
    """
105
107
    takes_args = ['filename?']
106
 
    takes_options = ['strip']
107
 
    def run(self, filename=None, strip=1):
 
108
    takes_options = ['strip','bzrdiff']
 
109
    def run(self, filename=None, strip=-1, bzrdiff=0):
108
110
        from patch import patch
109
111
        from bzrlib.branch import Branch
110
112
        b = Branch.open_containing('.')[0]
111
 
        return patch(b, filename, strip)
 
113
        if strip == -1:
 
114
            if bzrdiff: strip = 0
 
115
            else:       strip = 1
 
116
 
 
117
        return patch(b, filename, strip, legacy= not bzrdiff)
112
118
 
113
119
 
114
120
class cmd_shelve(bzrlib.commands.Command):