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

Joe Ferr jferr at Brocade.com
Tue Nov 16 16:15:21 UTC 2010



-----Original Message-----
From: gerg.ward at gmail.com [mailto:gerg.ward at gmail.com] On Behalf Of Greg Ward
Sent: Tuesday, November 16, 2010 8:40 AM
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 11:19 PM, Joe Ferr <jferr at brocade.com> wrote:
> 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.

See Matt's response: you can use "hg status" to stitch together
everything you need.

> 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.

That's not the Mercurial way, because it's not the Unix way.
Mercurial and Unix provide all the tools you need to do this.  Put 'em
together in a little shell script and you're done.  Here's one
possible approach:

  # X is the changeset of the previous run
  # Y is the  new changeset containing new/changed scripts
  hg update Y
  files=`hg status -nma --rev X:Y`
  tmpdir=`mktemp -d`
  tar -cf - $files | (cd $tmpdir && tar -xf -)
  cd $tmpdir
  for script in $files;
      run $script
  done

That make a couple of assumptions:
  * no spaces in filenames or directory names
  * all modified files are valid database scripts -- you might need to
pass some filters to "hg status" to ensure that

Completely untested, of course.  YMMV.

Greg



Thanks Greg and Matt.  That's what I was looking for...appreciate the help and the quick response.



More information about the Mercurial mailing list