http://bugs.grommit.com/show_bug.cgi?id=363
Summary: utility to compare TeamWare and Mercurial trees
Product: SCM Migration
Version: unspecified
Platform: All
OS/Version: Solaris 11/Nevada
Status: NEW
Severity: enhancement
Priority: P4
Component: other
AssignedTo: scm-migration-dev at opensolaris.org
ReportedBy: mike.kupfer at sun.com
It may be useful to have a utility for comparing a TeamWare source
tree with a Mercurial source tree. I've needed this once so far, to
verify repairs after a problem with the bridge.
The reason this is non-trivial is that the TeamWare tree has expanded
SCCS keywords, and the Mercurial tree has unexpanded keywords. So a
straight "diff -ur" will have too many false positives to be useful.
Here's what I did to verify correctness of repairs after that bridge
failure. Hopefully it can be scripted.
1. Generate a list of files for each workspace, using something like
"find usr deleted_files -type f -print". (That's the Teamware
workspace, the open Mercurial repository, and the closed Mercurial
repository.) Strip the .hg tree and SCCS files from the lists.
Merge the two Mercurial lists into a single list with usr/src and
usr/closed.
2. Patch up the list of deleted closed files. This is the step that
will take some thought on how to do correctly. All of the deleted
closed files are in the closed Mercurial repository, under
deleted_files. But in the Teamware workspace, some are under
deleted_files/usr/src and some are under deleted_files/usr/closed.
(The ones under deleted_files/usr/src are presumably all
pre-launch.) We don't want that to introduce false positives, but
we do want to detect (for example) a file that got deleted in
TeamWare but is still under usr in Mercurial.
3. Sort each list and compare them. Flag any files that appear in
only one list.
4. Compare the contents of files that appear in both lists. I
combined the two lists, ran the result through "sort -u", then fed
that to a hacky script that ignored files that appeared in only one
workspace. A cleaner approach might be to use /usr/xpg4/bin/grep
with -F and -f. Or step 3 could produce a list of common files at
the same time it's looking for files to flag.
The common files can be compared using sccskdiff, which is
something Bill Sommerfeld kindly provided and which I've attached.
sccskdiff assumes that a file has unexpanded keywords if it's
writable. This can fail if the Mercurial tree is not writable by
you (e.g., read-only NFS mount, or the tree is owned by a different
user). So we might want to change sccskdiff to tell it which file
has expanded keywords and which doesn't.
--
Configure bugmail: http://bugs.grommit.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.