Getting Started

Getting started with hg-buildpackage is pretty simple. This chapter shows you how.


The hg-buildpackage Repository Layout

hg-buildpackage assumes that you have two "canonical" repositories for every Debian package. These repositories correspond to the upstream and the Debian versions of the package's source. The upstream repository tracks unmodified upstream versions. The Debian repository pulls in upstream patches, and also has the Debian-specific patches for your package. (Debian-native packages have no upstream version and thus no upstream repository.)


Upstream Repository

The upstream repository tracks changes to the upstream program. You can use hg-importorig or hg-importdsc to import upstream sources from tarballs, or you can use Mercurial to track a Mercurial-based upstream with hg clone and hg pull.

Each upstream version should be tagged with a tag nammed UPSTREAM_packagename_version. Note that the Debian revision doesn't appear in this tag. An example would be UPSTREAM_mypackage_1.0.5. If you use hg-importorig or hg-importdsc, this tag will be created for you automatically. If you manage your upstream repository manually, you should create the tag yourself using hg tag


Debian Repository

The Debian repository tracks the Debian-specific package. The Debian package is represented as the upstream source plus a set of Debian patches. Upstream patches are normally pulled into the Debian repository before beginning on the Debian package.

Each Debian version carries a tag similar to the upstream version, but the Debian version tags begin with DEBIAN_ and contain a full Debian revision. An example is DEBIAN_mypackage_1.0.5-3.