~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2006-12-12 02:21:50 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20061212022150-7lqyw46pbb3jhkak
Clean up patch command (support http urls again)

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
 
180
180
strip_help="""Strip the smallest prefix containing num leading slashes  from \
181
181
each file name found in the patch file."""
182
 
Option.OPTIONS['bzrdiff'] = Option('bzrdiff',type=None,
183
 
                                help="""Handle extra bzr tags""")
184
182
 
185
183
 
186
184
class cmd_patch(bzrlib.commands.Command):
188
186
    """
189
187
    takes_args = ['filename?']
190
188
    takes_options = [Option('strip', type=int, help=strip_help)]
191
 
    def run(self, filename=None, strip=-1, bzrdiff=0):
 
189
    def run(self, filename=None, strip=None):
192
190
        from patch import patch
193
191
        from bzrlib.workingtree import WorkingTree
194
192
        wt = WorkingTree.open_containing('.')[0]
195
 
        if strip == -1:
196
 
            if bzrdiff: strip = 0
197
 
            else:       strip = 0
198
 
 
199
 
        return patch(wt, filename, strip, legacy= not bzrdiff)
 
193
        if strip is None:
 
194
            strip = 0
 
195
        return patch(wt, filename, strip)
200
196
 
201
197
 
202
198
class cmd_shelve(bzrlib.commands.Command):