Bazaar - Python-based VCS

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Monday, 22 December 2008

Toronto Zoo

Bazaar is a Python-based distributed versioning system, really simple lightweight and works under and with pretty much anything.

More here but to get it installed on your mac with macports just run...

sudo port selfupdate
sudo port install bzr

After it's installed and activated tell it who you are so it knows where all these changes are coming from in the future.

bzr whoami "John Doe <john.doe@gmail.com>"

You can check that's worked via

bzr whoami

Which should output who you told it you were,

Putting things under Bazaar

Next up it's real simple to start getting things stored under Bazaar, if you've used things like Mercurial or GIT then this should be a walk in the park,

First off navigate to the project you want to put under it then init a new Bazaar repository.

bzr init

Next up add all the files you want into the repos via,

bzr add .

...this'll add everything in the current directory you're in into the repository

Next up commit your files,

bzr commit -m 'initial code'

Should go smoothly listing all that you've done and give you a revision number (in this case 1).

You can then check the log for what's occured via,

bzr log

Which will show you the history, timestamps, user names & emails and messages posted so you can quickly see how things are evolving; and being Python it's pretty fast.

More here

Like most others, your repository is kept under a hidden system directory .bzr, find it easily with,

ls -a

However unlike others it doesn't mind what you put in it and will pack them tightly so it doesn't consume too much space, plus you can use it against any storage medium, current version at time of writing 1.1

Getting Mercurial to Ignore Stuff

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Saturday, 15 November 2008

Mercurial

Simple to do, first make your .hgignore file:

gedit .hgignore

Add to this some basic syntax

syntax: glob
*.sql
*.gz
.DS_Store
public/cache/*

(basically here you're telling mercurial what file extensions and directories to ignore in your app's root directory)

Save & close the file (nano: CTRL+Y, VI:esc then ':wq' + enter), now when you do hg add . and hg commit it'll skip these files & directories and keep your repository clean storing only the things you need to worry about; the code.

GIT Distributed Version Control

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Monday, 12 May 2008
Install
sudo aptitude install git-core
Basic Commands
git init                   ...init repository
git add .                  ...add everything in dir to repository
git commit -a -m 'update'  ...add + commit changes
git diff                   ...show changes since last commit

git add [file]             ...add file
git rm [file]              ...remove file
git mv [file]              ...move file
Mirror Git Repository
rsync -azvCL --delete --progress
   -e "ssh -i /home/[user]/.ssh/[mykey]" .git/* 
[user]@[user].strongspace.com:/home/[user]/[project]/.git/
Ignore Whitespace
git-apply --whitespace=nowarn