Wednesday April 09, 2008
It Must Be Time for TeaMike Kupfer's Weblog Converting Projects to Mercurial One of the things that we consider when deprecating components
of (Open)Solaris is how users move from the old software to the
new software. We've applied that principle to the SCM Migration
project, so we've been working on documentation (e.g., a Mercurial
cheat sheet for TeamWare users), and the updated tools work with
both TeamWare and Mercurial. Also, we don't want to tie the
schedules of large projects to the SCM Migration schedule or vice
versa. So we need to support projects that are begun under
TeamWare, but which are still under development when we're ready
to move the gate from TeamWare to Mercurial. That support is
provided by a new script called In general, it's hard to convert a TeamWare workspace to
Mercurial, at least if you want to maintain history. But ON
already has a policy that putbacks should (usually) add a single
delta. That is, any project-specific history will be lost
anyway. That makes the job of Suppose you have a project gate--call it
![]() It turns out that it is pretty easy for Let's walk through an example. Suppose I have a workspace that deletes all the SCCS helper scripts in usr/src/tools. And to demonstrate renames, it renames the scripts directory makefile to Makefile.new.
$ pwd
/export/kupfer/tonic/wx2hg-tests/tw.no-sccs-tools.demo
$ putback -n
...
Would put back name changes: 10
rename from: usr/src/tools/scripts/Makefile
to: usr/src/tools/scripts/Makefile.new
rename from: usr/src/tools/scripts/sccscheck.1
to: deleted_files/usr/src/tools/scripts/sccscheck.1
rename from: usr/src/tools/scripts/sccscheck.sh
to: deleted_files/usr/src/tools/scripts/sccscheck.sh
rename from: usr/src/tools/scripts/sccscp.1
to: deleted_files/usr/src/tools/scripts/sccscp.1
rename from: usr/src/tools/scripts/sccscp.sh
to: deleted_files/usr/src/tools/scripts/sccscp.sh
rename from: usr/src/tools/scripts/sccshist.sh
to: deleted_files/usr/src/tools/scripts/sccshist.sh
rename from: usr/src/tools/scripts/sccsmv.1
to: deleted_files/usr/src/tools/scripts/sccsmv.1
rename from: usr/src/tools/scripts/sccsmv.sh
to: deleted_files/usr/src/tools/scripts/sccsmv.sh
rename from: usr/src/tools/scripts/sccsrm.1
to: deleted_files/usr/src/tools/scripts/sccsrm.1
rename from: usr/src/tools/scripts/sccsrm.sh
to: deleted_files/usr/src/tools/scripts/sccsrm.sh
The following files are currently checked out and have been edited in workspace
"/export/kupfer/tonic/wx2hg-tests/tw.no-sccs-tools.demo":
usr/src/tools/scripts/Makefile.new
...
No changes were put back
$
Note that although Makefile.new is checked out, it need not be. Converting this to Mercurial is simple. If your TeamWare
workspace is in a directory that you have write access to, just
point
$ pwd
/export/kupfer/tonic/wx2hg-tests
$ /opt/onbld/bin/wx2hg tw.no-sccs-tools.demo
requesting all changes
adding changesets
adding manifests
adding file changes
added 6349 changesets with 91335 changes to 49774 files
44994 files updated, 0 files merged, 0 files removed, 0 files unresolved
Initializing wx...
...
New renamed file list:
...
New active file list:
...
Will backup wx and active files if necessary
...
wx initialization complete
usr/src/tools/scripts/Makefile.new already checked out
rename usr/src/tools/scripts/Makefile -> usr/src/tools/scripts/Makefile.new
rename usr/src/tools/scripts/sccscheck.1 -> deleted_files/usr/src/tools/scripts/sccscheck.1
rename usr/src/tools/scripts/sccscheck.sh -> deleted_files/usr/src/tools/scripts/sccscheck.sh
rename usr/src/tools/scripts/sccscp.1 -> deleted_files/usr/src/tools/scripts/sccscp.1
rename usr/src/tools/scripts/sccscp.sh -> deleted_files/usr/src/tools/scripts/sccscp.sh
rename usr/src/tools/scripts/sccshist.sh -> deleted_files/usr/src/tools/scripts/sccshist.sh
rename usr/src/tools/scripts/sccsmv.1 -> deleted_files/usr/src/tools/scripts/sccsmv.1
rename usr/src/tools/scripts/sccsmv.sh -> deleted_files/usr/src/tools/scripts/sccsmv.sh
rename usr/src/tools/scripts/sccsrm.1 -> deleted_files/usr/src/tools/scripts/sccsrm.1
rename usr/src/tools/scripts/sccsrm.sh -> deleted_files/usr/src/tools/scripts/sccsrm.sh
After the renames, it applies a patch for each modified file...
patching file usr/src/tools/scripts/Makefile.new
...and then you're done.
$ ls -dF *demo*
tw.no-sccs-tools.demo/ tw.no-sccs-tools.demo-hg/
You can verify that
$ cd tw.no-sccs-tools.demo-hg
$ hg diff -g
diff --git a/usr/src/tools/scripts/sccscheck.1 b/deleted_files/usr/src/tools/scripts/sccscheck.1
rename from usr/src/tools/scripts/sccscheck.1
rename to deleted_files/usr/src/tools/scripts/sccscheck.1
diff --git a/usr/src/tools/scripts/sccscheck.sh b/deleted_files/usr/src/tools/scripts/sccscheck.sh
rename from usr/src/tools/scripts/sccscheck.sh
rename to deleted_files/usr/src/tools/scripts/sccscheck.sh
diff --git a/usr/src/tools/scripts/sccscp.1 b/deleted_files/usr/src/tools/scripts/sccscp.1
rename from usr/src/tools/scripts/sccscp.1
rename to deleted_files/usr/src/tools/scripts/sccscp.1
diff --git a/usr/src/tools/scripts/sccscp.sh b/deleted_files/usr/src/tools/scripts/sccscp.sh
rename from usr/src/tools/scripts/sccscp.sh
rename to deleted_files/usr/src/tools/scripts/sccscp.sh
diff --git a/usr/src/tools/scripts/sccshist.sh b/deleted_files/usr/src/tools/scripts/sccshist.sh
rename from usr/src/tools/scripts/sccshist.sh
rename to deleted_files/usr/src/tools/scripts/sccshist.sh
diff --git a/usr/src/tools/scripts/sccsmv.1 b/deleted_files/usr/src/tools/scripts/sccsmv.1
rename from usr/src/tools/scripts/sccsmv.1
rename to deleted_files/usr/src/tools/scripts/sccsmv.1
diff --git a/usr/src/tools/scripts/sccsmv.sh b/deleted_files/usr/src/tools/scripts/sccsmv.sh
rename from usr/src/tools/scripts/sccsmv.sh
rename to deleted_files/usr/src/tools/scripts/sccsmv.sh
diff --git a/usr/src/tools/scripts/sccsrm.1 b/deleted_files/usr/src/tools/scripts/sccsrm.1
rename from usr/src/tools/scripts/sccsrm.1
rename to deleted_files/usr/src/tools/scripts/sccsrm.1
diff --git a/usr/src/tools/scripts/sccsrm.sh b/deleted_files/usr/src/tools/scripts/sccsrm.sh
rename from usr/src/tools/scripts/sccsrm.sh
rename to deleted_files/usr/src/tools/scripts/sccsrm.sh
diff --git a/usr/src/tools/scripts/Makefile b/usr/src/tools/scripts/Makefile.new
rename from usr/src/tools/scripts/Makefile
rename to usr/src/tools/scripts/Makefile.new
--- a/usr/src/tools/scripts/Makefile.new
+++ b/usr/src/tools/scripts/Makefile.new
@@ -50,11 +50,6 @@ SHFILES= \
nightly \
onblddrop \
protocmp.terse \
- sccscheck \
- sccscp \
- sccshist \
- sccsmv \
- sccsrm \
sdrop \
webrev \
ws \
$
Note that you still need to do "hg commit" to check in your new version. All this assumes that your workspace is in sync with /ws/onnv-clone. If it isn't you may get messages like
wx2hg: can't rename: usr/src/tools/scripts/sccscheck.1 doesn't exist.
or
wx2hg: usr/src/tools/scripts/Makefile.new: parent mismatch;
resync with /ws/onnv-clone or specify branch point with -r hg_rev.
Doing a bringover from /ws/onnv-clone, and resolving any conflicts, should fix things up. You may also see a message like
Please run
hg --cwd /export/kupfer/tonic/wx2hg-tests/tw.no-sccs-tools.demo-hg update -C
before retrying.
This is telling you you can reuse the Mercurial child, but you
need to reset it first. Once you've resynched with /ws/onnv-clone
and run the "hg ... update..." command, you use the
/opt/onbld/bin/wx2hg -t tw.no-sccs-tools.demo-hg tw.no-sccs-tools.demo
There's more that Comments:
Post a Comment: Comments are closed for this entry. |
Calendar
RSS Feeds
All /General /OpenSolaris /Solaris SearchLinks
NavigationReferersToday's Page Hits: 55 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||