Mercurial and Oracle Apps version control (lot's of DDL)

Joe Ferr jferr at Brocade.com
Mon Nov 15 22:19:48 CST 2010



-----Original Message-----
From: gerg.ward at gmail.com [mailto:gerg.ward at gmail.com] On Behalf Of Greg Ward
Sent: Monday, November 15, 2010 8:44 PM
To: Joe Ferr
Cc: mercurial at selenic.com
Subject: Re: Mercurial and Oracle Apps version control (lot's of DDL)

On Mon, Nov 15, 2010 at 2:56 PM, Joe Ferr <jferr at brocade.com> wrote:
> We currently use a workflow based tool (HP PPM aka Mercury IT Governance aka
> Kintana) to drive our process.  With Clearcase a developer requests one or
> more file/revision combinations from Clearcase via the tool and the tool
> executes (at the appropriate place/time after approvals etc) SQLplus which
> runs/executes the script(s) and routes in the workflow based on whether the
> script executed successfully (determined via Unix error code).
>
> So, just having access to the code tree (say a branch which “looks like”
> production) doesn’t handle this since I really need the files (not a list of
> files, the files) which have been added or modified since the previous
> deployment.  For reporting/visibility end users or QA personal need to
> easily see which DDL scripts have been executed (e.g. diffs).

It's not at all clear what you're asking for.  Keep in mind that the
people on this list know a lot about files, changesets, diffs,
patches, and Mercurial stuff, but very little about Oracle and exactly
nothing about your business.  So ask concrete questions using terms we
understand, and we'll get somewhere.

Anyways.  It sounds to me like you need to drink the Kool-Aid and
understand what a changset is.  Hint: it's a snapshot of your entire
source tree at a particular moment in time.  That moment is specified
by a developer running "hg commit".  So if you update to changeset X,
*boom* there are all the files from that changeset.  Getting diffs or
lists of files changed is actually a teeny bit harder than simply
getting the files.  ("hg diff -r X:Y" gives you a diff from changeset
X to Y, and "hg status --rev X:Y" gives you a list of
modified/added/removed files between them.)

As for recording which scripts have been executed: that's not what
version control is for.  Are you looking for "make" or similar tool?
(E.g. use a Makefile to drive everything.  Have it touch a timestamp
file for each script executed.  There's your record of what got
executed, and if you do it right, make will know what needs to be
executed, because its timestamp file is missing or stale.)

Greg



Thanks Greg,

I've had the Coolaid and like it!...I do/have used mercurial quite a bit for traditional "grab it all and compile it or deploy it" type code...Java, Perl, Python, C.  My problem is figuring out how to use it to control DB objects.

Let me take Oracle out of the picture and call it a generic application with a SQL database (Mysql, Postgres, whatever).  Say that this application has 200 stored procedures in the database.
To create a stored proc you would create a DDL script ("create or replace PROCEDURE FOO"...).  These scripts would be checked into version control.  When it comes time to "build/deploy" I need to take all of the scripts which have been added or changed since the previous deployment (id'd by tag or changeset)and execute them.  I could use make with timestamp files (thanks for that suggestion...I'll give it some thought) or our fancy (and expensive, so I better use it!) HP workflow tool for this part. 

I think that using hg status --rev X:Y would work if there wasn't a better option.  I would need to parse the output of this command to figure out which files I'd need to copy/execute.
What I'm ideally looking for...it would be great if I could get this both from the command line and from hgweb...is a way to get all of these files in one command.  E.g. an export command which would let me pass two identifiers (tags or revs) and a directory name and mercurial would retrieve all files changed or added between these two tags/revs.  

Thanks,
Joe





More information about the Mercurial mailing list