Harmonize RCS with Monotone - Page 2
Now add some files to your project. This example adds a directory of files to the working directory:
$ monotone --branch=config_files --db=~/project1/project1.db add configs/ monotone: adding configs/apache-1.3-https to working copy add set monotone: adding configs/postfix-sa to working copy add set
Then commit the additions:
$ monotone commit '1st commit of configs for branch office servers' monotone: committing e85116a6c24df94037ae4ccd60645e0044da58a5 monotone: committing to branch config_files enter passphrase for key ID [carla@mydomain.net]: monotone: committed e85116a6c24df94037ae4ccd60645e0044da58a5
There are a couple of gotchas to look out for. Monotone does not allow absolute filepaths when you're listing files or directories to add to the repository. In this example, I made sure the Monotone binary was in my path, then ran the "add" and "commit" commands from the next directory above the "configs" directory. If Monotone is not in your path, you are doomed to specifying the entire path every time you run it, like ~/downloads/monotone-0.14/monotone.
Check the status of your nice new branch with this command:
$ monotone heads monotone: fetching heads of branch 'config_files' branch 'config_files' is currently merged: e85116a6c24df94037ae4ccd60645e0044da58a5 carla@mydomain.net 2004-10-01T20:41:06
The "status" command reports any changes to the database:
$ monotone status Old manifest: e85116a6c24df94037ae4ccd60645e0044da58a5 New manifest: e85116a6c24df94037ae4ccd60645e0044da58a5 Summary of changes: no changes
Suppose you want to edit a file. Just open and edit the file as you normally would, and save your changes. Then use the "commit" command to add the changed file to the repository:
$ monotone commit monotone: committing b102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6 monotone: committing to branch config_files enter passphrase for key ID [carla@mydomain.net]: monotone: committed b102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6
Like any other RCS, your default editor will open to make the changelog entry.
Visualizing Confusion
![]() |
(Click for a larger image) |
$ monotone agraph graph: { node: { title : "71edb60beae79dc350cee1050af7c37ac04ddc9a" label : "\fb71edb60beae79dc350cee1050af7c37ac04ddc9a\n\fnconfig_files"} node: { title : "b102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6" label : "\fbb102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6\n\fnconfig_files"} node: { title : "e85116a6c24df94037ae4ccd60645e0044da58a5" label : "\fbe85116a6c24df94037ae4ccd60645e0044da58a5\n\fnconfig_files"} edge: { sourcename : "b102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6" targetname : "71edb60beae79dc350cee1050af7c37ac04ddc9a" } edge: { sourcename : "e85116a6c24df94037ae4ccd60645e0044da58a5" targetname : "b102fc029bde2d6b50c6e5bfd9d79ec2cba7cbc6" } }
Then copy the output to a file, and generate a nice graph showing the evolution of your Monotone tree:
$ xvcg graph -
This spits out a graph like the one in Figure 1. (Note that it shows three levels, while only two levels were created in this article.)
Checkouts And Netsync
Come back next week to find out how to manage checkouts, share over a network, and find things in your repository. Or haul yourself over to Monotone now and get a head start.
Resources
- Monotone home page
- Monotone-devel list archives. Lots of good help here.