darcs

" Darcs is a free, open source source code management system.

At its most basic level, the theory of patches is about the commutation, or reordering, of changes in such a way that their meaning doesn't change. The rules of commutation tell us when, for example, one patch requires another, since dependent patches cannot be commuted. Once the commutation primitives have been worked out, one can do all sorts of interesting (and useful) operations, such as merging. And such operations can be shown to be independent of order, i.e. it doesn't matter whether you merge patch A or patch B first, you'll get the same result. David Roundy

"Arch really is the only other revision control system I am aware of which is really change-oriented. Other systems may be change/set/ oriented, but fundamentally they keep track of versions, rather than changes." David Roundy
NB: dans darcs, un repository est simplement un ensemble de patches.

Commands

See darcs commands

  • darcs changes: affiche les changements effectués
    • options
      • --summary (or -s) summarizes the files changed
      • --verbose (or -v) shows the actual diffs
      • --patches (or -p) lets you filter
  • darcs get from host to path: récupération d'un répertoire depuis le serveur host et stockage dans le chemin local path
  • darcs put to host from path: envoi au serveur host de l'ensemble des patches appliqués localement dans path depuis le dernier envoi
  • darcs pull: comme get, mais incrémental
  • darcs push: comme put, mais incrémental
  • darcs revert: reverses a patch and completely removes it from history. All changes are lot unless you have the patch in another repository.

Patch dependencies

Source: http://slipgate.za.net/darcs/darcs_osdc/slides/start.html

Patches in darcs are commutative:

  • They have no chronological order
  • Only dependency order
"* A patch contains two parts:
    • Metadata (which files have changed and how)
    • Textual delta (the actual differences)
  • Patch A introduces one line...
    • Patch B changes it...
    • To apply patch B we first need to apply patch A
    • That's a Patch Dependency
  • Patch dependencies form a Directed Acyclic Graph
  • Patches can be applied in any order
    • ...as long as they don't depend on each other"
Tag: A patch with no content that depends on all the other patches. "darcs get -t tagname"

"There are two kinds of dependencies: implicit dependencies and explicit dependencies. Implicit dependencies is the far most common kind. These are calculated automatically by darcs. If a patch removes a file or a line of code, it will have to depend on the patch that added that file or line of code.5.4If a patch adds a line of code, it will usually have to depend on the patch or patches that added the adjacent lines.

Explicit dependencies can be created if you give the --ask-deps option to darcs record. This is good for assuring that logical dependencies hold between patches. It can also be used to group patches --a patch with explicit dependencies doesn't need to change anything -- and pulling the patch also pulls all patches it was made to depend on."

Conflicts

"Darcs will refuse to apply a conflicting patch Unless you say… --external-merge, --mark-conflicts"

"A merge patch depends on two conflicting patches, and contains a diff that merges them. The conflicting parts are overridden by the merge."

See darcs manual section on conflicts

Privacy

Concept of private patches.

Live examples

XML output

darcs changes --xml-output
<changelog>
<patch author='me@email.com' date='20040605033308' local_date='Sat Jun  5 05:33:08 CEST 2004'
 inverted='False' hash='20040605033308-e14b9-451ae7bc1c4e822940526960e4d8a1faed2f5ed4.gz'>
        <name>initial import of hello.txt</name>
</patch>
</changelog>
Version 1.18 last modified by Stéphane Laurière on 24/08/2007 at 10:28

Comments 0

No comments for this document

Attachments 0

No attachments for this document
Partenaires


Creator: Stéphane Laurière on 2007/06/21 10:15
Copyright INRIA, ENST, EISTI, Mandriva, XPertNet
1.1.1