Jakob Malm wrote, On 12/19/2012 09:47 AM:
> Hi,
>
> My company is using IBM Rational Rhapsody for software development
> using UML and code generation. The models are saved in an xml format
> with file extensions .sbs. These files can be diff'ed and merged using
> Rational Rhapsody DiffMerge, and I have set up my mercurial.ini to use
> it as visual diff and merge tool for such files, from tortoisehg.
>
> Rhapsody DiffMerge shows a conflict when file names differ, and there
> is nothing I can do to change that.
>
> It seems that there is a difference in how mercurial or tortoiseHg
> generates diff files and merge files to the file system. Diff files
> have the same file name, but are placed in different temporary
> directories, whereas merge files (base, local, other) get changed
> filenames, e.g. somefile.sbs~base<random characters>.
>
> I believe that the following pieces of code in
> mercurial.filemerge.filemerge() is responsible for setting the
> filenames for merge files:
>
> (line 274, hg-stable repo:)
> def temp(prefix, ctx):
> pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
> (fd, name) = tempfile.mkstemp(prefix=pre)
> data = repo.wwritedata(ctx.path(), ctx.data())
> f = os.fdopen(fd, "wb")
> f.write(data)
> f.close()
> return name
>
> ...
>
> (line 308:)
> a = repo.wjoin(fd)
> b = temp("base", fca)
> c = temp("other", fco)
>
> I haven't been able to find the code that is responsible for setting
> up diff files. Would it be in tortoiseHg or mercurial?
I guess uses the 'extdiff' extension - see doc/source/common.txt .
> I would like to prepare a patch for mercurial to change the set up of
> merge files to preserve file names and instead put them in different
> temporary directories, analogously to how the diff files are set up. I
> now this is not the mercurial list, but do you think that such a patch
> could be accepted? If not, would it be possible to modify this
> behaviour in tortoiseHg instead?
A much simpler solution be to use a simple wrapper script for your merge
tool, using your favourite scripting language.
Considering this alternative I doubt Mercurial will accept a patch ...
and I don't see why TortoiseHg should. But it could perhaps be shipped
like win32/docdiff.py if you are on windows.
/Mads
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Tortoisehg-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss