Cygwin+WindowsVisualDiffApp support

Bug #162919 reported by jenisys
2
Affects Status Importance Assigned to Milestone
Bazaar Difftools Plugin
New
Undecided
Unassigned

Bug Description

PLATFORM: Cygwin (using Bazaar from Cygwin shell)

WinMerge and other Windows VisualDiff/Merge applications require
Windows/POSIX filenames. Currently, WinMerge is started with
Cygwin-specific pathnames which WinMerge (and other apps) cannot handle.

REQUIRED-CHANGE:
On Cygwin platform, filenames should be converted to DOS/POSIX format.
It would even, if filepath transformation rules could registered for
some platforms or when the specific DiffTool is registered.

PATCH (QUICKFIX):
file:difftool.py
context:DiffTool.run() method
    ...
    # XXX-JE-PATCH: Cygwin-to-DOS Files Names.
    import sys
    if sys.platform == "cygwin":
        # -- CYGWIN-ENIRONMENT: Running system but maybe call Windows apps.
        # REQUIRE: Filename conversion to DOS-like filenames (POSIX).
        # /cygdrive/V/my/FileUnderVersionControl -> V:/my/FileUnderVersionControl
        # /tmp/.../FileUnderVersionControl.1234 -> C:/cygwin/tmp/.../FileUnderVersionControl.1234
        CYGWIN_DOS_PREFIX = "C:/cygwin/" #< BETTER: Auto-detect or in ConfigFile.
        if new_path.startswith("/cygdrive/"):
            new_path2 = new_path.replace("/cygdrive/", "", 1)
            new_path = "%s:%s" % (new_path2[0], new_path2[1:])
        if old_path.startswith("/"):
            old_path = "%s%s" % (CYGWIN_DOS_PREFIX, old_path[1:])
    # XXX-JE-PATCH-END.
    run_tool = [self.command] + diff_opts + [old_path, new_path]
    # XXX-JE-PATCH: Cygwin-to-DOS Files Names.
    debug_visualdiff_call = True
    if debug_visualdiff_call:
        print "Bazaar difftool: %s" % " ".join(run_tool)
    # XXX-JE-PATCH-END.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.