Prev | Current Page 450 | Next

Brad Ediger

"Advanced Rails"


First, we clone the trunk to a new feature branch:
$ hg clone trunk trunk-newcolors
47 files updated, 0 files merged, 0 files removed, 0 files unresolved
* Google uses a similar method, without explicit developer branches, for its internal development. They use
NFS, Perforce, and a code review tool called Mondrian developed by Guido van Rossum.
304 | Chapter 10: Large Projects
Now trunk-newcolors contains an identical copy of the trunk, including all history.
We are going to make changes to trunk-newcolors, preview them, and then merge
them back into trunk.We now make the appropriate changes to trunk-newcolors and
commit them:
$ cd trunk-newcolors/
$ sed -ie 's/color: red/color: blue/g' public/stylesheets/main.css
$ hg ci -m "Changed red to blue in main stylesheet"
$ hg tip
changeset: 1:18bb8b07ec40
tag: tip
user: Brad Ediger
date: Fri Oct 26 13:08:01 2007 -0500
summary: Changed red to blue in main stylesheet
We can preview this line of development for as long as we like, and then merge it
back into trunk. To merge, we first pull the changes from trunk-newcolors into the
trunk repository:
$ cd ../trunk/
$ hg pull ../trunk-newcolors
pulling from ../trunk-newcolors
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
This indicates that there have been changes to the trunk since the branch, so we will
need to merge.


Pages:
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462