n00b questions

Michael Smith michael.smith at thalesatm.com
Sun Jul 6 18:02:30 CDT 2008


dkarbott at comcast.net wrote:

> 3. Are there any good examples out there of scripts / programs which create 
> incremental update bundles?  i.e. I want to incrementally create a sequence 
> of bundles with non-overlapping changesets such that you can re-create a 
> mirror of the repository by pulling them in order.  It seems like someone 
> else must have attacked this problem.

I use this script to exchange bundles between home and work. It uses a 
local tag "REMOTE" to mark the presumed tip of the remote repository. If 
it is called with arguments it unbundles the files it is given, 
otherwise it creates a bundle.

#! /bin/ksh
if [ "$*" ]
then
     for arg in $*
     do
         echo "unbundling $arg"
         hg unbundle $arg
         rm $arg
     done
     hg update
else
     APP=`basename $PWD`
     NUMBER=`date "+%G%m%d%H%M"`
     CHANGESET="/tmp/$APP-changeset-$NUMBER.hg"
     hg bundle -q --base REMOTE $CHANGESET
     synchmail $CHANGESET $APP
     echo "changeset: " $CHANGESET
fi
hg tag --local -f REMOTE


The script "synchmail" sends an email message:

#! /bin/ksh
nail -s "[$2] $1" -a $1 -A smithmr user at host.com.au < /dev/null

-- 
Michael Smith        | 61 386 304 560
Case and Tools Team  | 61 416 062 898
Thales Australia TCC |    S  37.82329
Melbourne, Victoria  |    E 144.95426
--------------------------------------------
Confidentiality Notice: This e-mail may contain confidential and/or 
privileged information and is intended solely for the addressee(s) 
named. If you have received this information in error, or are advised 
that you have been posted this e-mail by accident, please notify the 
sender by return e-mail, do not redistribute it, delete the e-mail and 
keep no copies.


More information about the Mercurial mailing list