~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-12 21:44:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4737.
  • Revision ID: john@arbash-meinel.com-20091012214427-zddi1kmc2jlf7v31
Py_ssize_t and its associated function typedefs are not available w/ python 2.4

So we define them in python-compat.h
Even further, gcc issued a warning for:
static int
_workaround_pyrex_096()
So we changed it to:
_workaround_pyrex_096(void)

Also, some python api funcs were incorrectly defined as 'char *' when they meant
'const char *'. Work around that with a (char *) cast, to avoid compiler warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
 
172
172
        if not diff_opts:
173
173
            diff_opts = []
 
174
        if sys.platform == 'win32':
 
175
            # Popen doesn't do the proper encoding for external commands
 
176
            # Since we are dealing with an ANSI api, use mbcs encoding
 
177
            old_filename = old_filename.encode('mbcs')
 
178
            new_filename = new_filename.encode('mbcs')
174
179
        diffcmd = ['diff',
175
180
                   '--label', old_filename,
176
181
                   old_abspath,
272
277
                        new_abspath, e)
273
278
 
274
279
 
275
 
def _get_trees_to_diff(path_list, revision_specs, old_url, new_url,
276
 
    apply_view=True):
 
280
def get_trees_and_branches_to_diff(path_list, revision_specs, old_url, new_url,
 
281
                                   apply_view=True):
277
282
    """Get the trees and specific files to diff given a list of paths.
278
283
 
279
284
    This method works out the trees to be diff'ed and the files of
336
341
            views.check_path_in_view(working_tree, relpath)
337
342
        specific_files.append(relpath)
338
343
    old_tree = _get_tree_to_diff(old_revision_spec, working_tree, branch)
 
344
    old_branch = branch
339
345
 
340
346
    # Get the new location
341
347
    if new_url is None:
349
355
            specific_files.append(relpath)
350
356
    new_tree = _get_tree_to_diff(new_revision_spec, working_tree, branch,
351
357
        basis_is_default=working_tree is None)
 
358
    new_branch = branch
352
359
 
353
360
    # Get the specific files (all files is None, no files is [])
354
361
    if make_paths_wt_relative and working_tree is not None:
373
380
    extra_trees = None
374
381
    if working_tree is not None and working_tree not in (old_tree, new_tree):
375
382
        extra_trees = (working_tree,)
376
 
    return old_tree, new_tree, specific_files, extra_trees
 
383
    return old_tree, new_tree, old_branch, new_branch, specific_files, extra_trees
377
384
 
378
385
def _get_tree_to_diff(spec, tree=None, branch=None, basis_is_default=True):
379
386
    if branch is None and tree is not None: