webdev xaraya
(5,484 views)

Monotone for xaraya development

Notes on installing and using the source code repository for Xaraya.

 

Setup

Download the program

from http://venge.net/monotone

I got the osx (universal) version.

mv it to /usr/local
chmod +x

Download the databases

from http://mt.xaraya.com/

Grab the "Initial download" databases.

I'll make my project directory ~/xaraya/mtn/ . Uncompress the downloads into there.

Create a security key:

mtn -d modules.db genkey your@validemail.com
(creates ~/.monotone/keys/your@validemail.com file containing key pair)

Setup the scripts

download xaraya.rc from http://mt.xaraya.com/ into ~/.monotone

Create a script monotonrc something like as follows:

qa_location= "/Users/jonathan/xaraya/mtn/qatests/tests/"
dofile("/Users/jonathan/.monotone/xaraya.rc")
function get_passphrase(identity)
if (identity == "your@validemail.com")
then return "secret" end
end

get Johnny's scripts from http://www.xaraya.com/~johnny (i can get you a copy too if these go away):

xarpull
xarcomods
xarcothemes

And edit the scripts for correct pathnames

(I also made a xarcocore for the core db)

Pull most recent branches

cd ~/xaraya/mtn

mtn -d core.db pull mt.xaraya.com com.xaraya.core
mtn -d core.db pull mt.xaraya.com com.xaraya.documentation
mtn -d core.db pull mt.xaraya.com com.xaraya.qa.test

mtn -d modules.db pull mt.xaraya.com com.xaraya.modules.*
mtn -d themes.db pull mt.xaraya.com com.xaraya.themes.*

or

./xarpull

Check out working copies

mkdir qatests
mtn -d core.db co -b com.xaraya.qa.tests qatests
mkdir core
mtn -d core.db co -b com.xaraya.core core
./xarcomods
./xarcothemes

(first time through, the scripts create the directories).

Working and Using

Edit you code, then commit it to the local database. But make sure the local db is up to date first from the repository, or you'll create some splits that will need to be merged.

Refresh Local Copy

Pull again

./xarpull

Update working directory

./xarcocore
./xarcomods
./xarcothemes

(this time the scrips use "update" command)

Commit

mtn commit -m "This is my message,
put more lines here,
Bug number" and/specify/file/if/necssary.txt

Divergence

When committing, if my change creates a divergence,

mtn merge

To see the diff of the divergence,

mtn log --last=2

mtn diff file.php -r 1c9239f1d33acc18ca1fa7a40d9c355e86215050 -r c93128f60037cb613771cfa11bc9ea518eb0a401

 

Push

Push your local db to the central repository.

mtn -d modules.db push mt.xaraya.com com.xaraya.modules.example
or
mtn -d core.db push mt.xaraya.com com.xaraya.core

Bugzilla

If one, update the bugzilla posting for this fix.

 

Other

Additional comments

mtn comment --revision=myrevid

what's changed

mtn ls changed

accessing a db other than default

may need to specify the key on the command, such as

-kjlinowes@xaraya.com

 

The Manifest (list of files it knows about)

add a new file

mtn add file.nam

status

mtn ls unknown

mtn ls unknown .

(dot says look in subdir)

mtn ls missing

 

Errors

When committing:

mtn: warning: restriction includes unknown path 'path/to/file.name'

File isnt in the db, use 'mtn add' command.

 

Setting up Monotone for Other Projects

OK, so now we're all set as a committer to the Xaraya project, using the Xaraya repositories.  Now I want to use monotone for my own web projects. (And for now, just on my local machine. I'll add the synchronizing over the network later). So this is just the basics as covered in the documentation tutorial.

Create a Database
$ cd to the www dir (above all the webroots)

$ mtn db init --db="parkerhill.mtn"

generate key
$ mtn genkey jonathan@parkerhill.com
: enter passphrase
mtn: storing key-pair 'jonathan@parkerhill.com' in /Users/jonathan/.monotone/keys/

define a get_passphrase function so dont have to enter it all the time
(see tutorial pg 23)

Start a new project as a branch

$ cd to web root

- create a workspace, in current dir (dir name blank) with given db name and branch name
$ mtn --db=../parkerhill.mtn --branch=com.parkerhill.mysite setup

Add Files
from web root
$ mtn add themes/talumbiz

Check In Changes
$ mtn commit --message="initial checkin of project"
$ mtn commit --message="what i did today"

Where am I?
$ mtn status
$ mtn diff
$ mtn heads
 

[Note, the Xaraya qa tests got annoying at this point, so I temporarily comment them out by adding "-- " to the first 2 lines of ~/.monotone/monotonerc . I need to figure out how to make them conditional, or some way to avoid having to use the --rcfile= option every time we run mtn]

 


 

 

 

Comments

New Comment

markdown formatting permitted