5. Source Control Management

5.1. Kallithea

Kallithea is a Python software providing github functionality, forks, pull requests. Source line annotations.

5.2. Mercurial Repository Trimming

See CommunicatingChanges - Mercurial for descriptions of import/export, bundle/unbundle.

Use revsets for specifying a range of revisions (see revsets - Mercurial).

Implicit range endpoints of --rev option for bundle, etc. follow the DAG algorithm (ancestors) of x..y and x::y ranges. Use x:y to get all revisions between x and y, regardless of ancestry.

mkdir -p ../repo-trimmed
hg bundle --base null --rev 0:240 ../repo-trimmed/bundle.hg
( cd ../repo-trimmed && hg init && hg unbundle bundle.hg)

When using hg convert, it is necessary to use the configuration parameter convert.hg.revs, since option –ref does not understand revsets:

hg convert –config convert.hg.revs=0:240 repo repo-trimmed

Using hg export and hg import, it is possilbe to cherry-pick changesets and move them to branches, etc.

cd repo
hg export --rev '262:263' >.00-merge.patch

cd ../repo-trimmed
hg import ../repo/00-merge.patch

Cherry-pick some changesets, move them on a branch and tag the result:

cd repo
hg export --rev '241 or 243:259 or 261' >01-branch-abstract-diagrams.patch

cd ../repo-trimmed
hg branch abstract-diagrams
hg import ../repo/01-branch-abstract-diagrams.patch
hg tag diag-1-too-abstract