I've searched the group for this problem and I'm surprised it's not
come up before, but it could just be me of course...

This would be my normal workflow: update my project's working copy in
Versions, do my work, run update again before committing. Now, at the
pre-commit update, let's say a colleague has changed and committed the
same file in the meantime, creating a conflict. Versions automatically
and without prompting goes into non-interactive conflict mode, putting
diff markers in my working file, saving the original to
[workingfile].mine, and creating the two [workingfile].rXX files to
contain the working copy's BASE and the repository's HEAD versions.
(Is that right?) So far, so good: this is what I would want.

However, when I go resolve things with FileMerge, I hit the following
problem. I want to compare the changes I've just made with the ones my
colleague has just made, so I click Compare Diff and in the new window
chose to compare the 'Modified file in Working Copy' with 'Existing
Revision in Repository' (HEAD). But it's too late to do this since the
[workingfile] Versions uses now has diff markers in it, preventing a
proper comparison. The file I want to compare with the repository HEAD
is now [workingfile].mine, which I'm not given the opportunity to use
for the diff.

When diffing to resolve a conflict like this, HEAD vs
[workingfile].mine using [workingfile] as the merge output is I think
how things work with eg ZigVersion, which seems more intuitive in this
respect. Does Versions not support this way of doing things? Is it
expecting me to be dealing with conflicts by running Compare Diff and
resolving before update or something like that? Am I missing
something?

My interim solution is the following quick python script to use with
the Compare Scripts method. Any suggestions for improvement welcome.
I'll upload to the files area if it seems there's any use for it.

It tries to maintain the default behaviour unless there seems to be a
conflict involving one of the input files, in which case it assumes
you want to compare the proper (.mine) amended working file with the
repository HEAD (maybe a bit of a leap, but this is always going to be
true how I would use it) and rewrites things accordingly, using the
overwritten amended working file (the one containing diff markers) as
the merge output file. Use FileMerge, hit save and you're ready to
tell Versions things are resolved.

#!/usr/bin/env python
import glob, os, re, sys

files = (sys.argv[1], sys.argv[2])
reposFile = ""
origFile = ""
conflicting = False

for thisFile in files:
    ext = os.path.splitext(thisFile)[1]

    if re.match("/var/folders.*com\.picodev\.Versions", thisFile):
        reposFile = thisFile; continue
    if ext == ".mine" or re.match("\.r\d+", ext):
        conflicting = True; continue

    # thisFile name must now be the real working file name
    # (ie no svn conflict file extension or a Versions temp file)
    origFile = thisFile
    if glob.glob(thisFile + ".r*"): conflicting = True
    if os.path.exists(thisFile + ".mine"): conflicting = True

if conflicting and origFile and reposFile:
    os.system("/usr/bin/opendiff %s %s.mine -merge %s" % (reposFile,
origFile, origFile))
else:
    os.system("/usr/bin/opendiff %s %s" % files)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Versions" group.
To post to this group, send email to versions@googlegroups.com
To unsubscribe from this group, send email to 
versions+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/versions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to