Next: , Previous: Tree, Up: Command Reference



5.2 Working Copy

monotone add pathname...
This command places “add” entries for the paths specified in pathname... in the working copy's “work list”. The work list of your working copy is located at MT/work, and is a list of explicit pathname changes you wish to commit at some future time, such as addition, removal or renaming of files.

While this command places an “add” entry on your work list, it does not immediately affect your database. When you commit your working copy, monotone will use the work list to build a new revision, which it will then commit to the database. The new revision will have any added entries inserted in its manifest.

monotone drop pathname...
This command places “drop” entries for the paths specified in pathname... in the working copy's “work list”. The work list of your working copy is located at MT/work, and is a list of explicit pathname changes you wish to commit at some future time, such as addition, removal, or renaming of files.

While this command places a “drop” entry on your work list, it does not immediately affect your database. When you commit your working copy, monotone will use the work list to build a new revision, which it will then commit to the database. The new revision will have any dropped entries removed from its manifest.

monotone rename src dst
This command places “rename” entries for the paths specified in src and dst in the working copy's “work list”. The work list of your working copy is located at MT/work, and is a list of explicit pathname changes you wish to commit at some future time, such as addition, removal, or renaming of files.

While this command places a “rename” entry on your work list, it does not immediately affect your database. When you commit your working copy, monotone will use the work list to build a new revision, which it will then commit to the database. The new revision will have any renamed entries in its manifest adjusted to their new names.

monotone commit
monotone commit --message=logmsg
monotone commit pathname...
monotone commit --message=logmsg pathname...
This command looks at your working copy, decides which files have changed, and saves the changes to your database. It does this by loading the revision named in the MT/revision file, locating the base manifest for your working copy, applying any changes described in the MT/work file, and then comparing the updated base manifest to the files it finds in your working copy, to determine which files have been edited.

For each edited file, a delta is copied into the database. Then the newly constructed manifest is recorded (as a delta) and finally the new revision. Once all these objects are recorded in you database, commit overwrites the MT/revision file with the new revision ID, and deletes the MT/work file.

Specifying pathnames to commit restricts the set of changes that are visible and results in only a partial commit of the working copy. Changes to files not included in the specified set of pathnames will be ignored and will remain in the working copy until they are included in a future commit. With a partial commit, only the relevant entries in the MT/work file will be removed and other entries will remain for future commits.

From within a subdirectory of the working copy the commit command will, by default, include all changes in the working copy. Specifying only the pathname "." will restrict commit to files changed within the current subdirectory of the working copy.

The commit command also synthesizes a number of certificates, which it attaches to the new manifest version and copies into your database:


monotone revert
monotone revert pathname...
With no files given, this command changes your working copy, so that changes you have made since the last checkout or update are discarded. It does this by changing every file listed in the working copy's base manifest to have contents equal to the sha1 value listed in the manifest, and by erasing the MT/work file.

If files or directories are given as arguments, only those files and directories are affected instead of the entirety of your working copy.

From within a subdirectory of the working copy the revert command will, by default, revert all changes in the working copy. Specifying only the pathname "." will restrict revert to files changed within the current subdirectory of the working copy. Caution should be used when reverting files to ensure that the correct set of files is reverted.

monotone update
monotone update revision
Without a revision argument, this command incorporates “recent” changes found in your database into your working copy. It does this by performing 3 separate stages. If any of these stages fails, the update aborts, doing nothing. The stages are:

With an explicit revision argument, the command uses that revision as the update target instead of finding an acceptable candidate.

The effect is always to take whatever changes you have made in the working copy, and to “transpose” them onto a new revision, using monotone's 3-way merge algorithm to achieve good results. Note that with the explicit revision argument, it is possible to update “backwards” or “sideways” in history — for example, reverting to an earlier revision, or if your branch has two heads, updating to the other. In all cases, the end result will be whatever revision you specified, with your local changes (and only your local changes) applied.