openlugaru for Debian
--------------------

Contents:
 1. Version control in Debian
    1.1 VCS setup for Debian changes
    1.2 VCS setup for new upstream versions

1. VERSION CONTROL IN DEBIAN
The Debian OpenLugaru git repository is set up as follows:

<googlecode mercurial>           master
                                   ||
<debian git>                     master
                                /      \
                           source       data
                           /                \
                    debian_source      debian_data

* <debian git> master:
  Converted directly from master branch of <http://code.google.com/p/lugaru>
  using git-hg from <https://github.com/offbytwo/git-hg>
* source:
  Branched from upstream_hg_master, Data items, Dependencies/, and Xcode/
  removed
* data:
  Branched from upstream_hg_master, Source items, Dependencies/, and Xcode/
  removed
* debian_source:
  Branched from source branch, debian packaging added (debian/)
* debian_data:
  Branched from data branch, debian packaging added (debian/)

Note that former merges have used different branch names than current.


1.1 VCS SETUP FOR DEBIAN CHANGES
Debian packaging work should happen on the debian_data branch, and NOT on
master. Hence, after a standard git clone it is convenient to do:
 $ git branch debian_data origin/debian_data
 $ git checkout debian_data

1.2 VCS SETUP FOR NEW UPSTREAM VERSIONS
In the case or releasing a new snapshot from upstream things are a bit more
complicated, the suggested way to set this up is is:
 i.   Clone the Debian git repository
 ii.  Use git-hg to clone the upstream mercurial repository
 iii. Manually add the hg integration to the Debian git clone
 iiv. Setup our local master branch to track the remote mercurial master branch
 iv.  Merge master into data
 v.   Merge data into debian_data
This integration does unfortunately not follow along as the git repository is
cloned, and hence will have to be setup locally for each person.

 i. Clone the Debian git repository
    $ git clone git://git.debian.org/git/pkg-games/lugaru.git openlugaru-debian

 ii. Use git-hg to clone the upstream mercurial repository
     $ git clone https://github.com/offbytwo/git-hg.git git-hg
     $ cd git-hg/

     Get the required fast-export submodule
     $ git submodule update --init

     Edit git-hg to call fast-export with --force, it will otherwise fail with
     "Error: repository has at least one unnamed head" for the lugaru repository
     $ sed s/\$HG_FAST_EXPORT\ -r/\$HG_FAST_EXPORT\ --force\ -r/ -i bin/git-hg
     $ cd ..
     $ git-hg/bin/git-hg clone https://lugaru.googlecode.com/hg/ openlugaru-hg-git

 iii. Manually add the hg integration to the Debian git clone
      $ cp -r lugaru-hg-git/.git/hgremote/ openlugaru-debian/.git/
      $ cp -r lugaru-hg-git/.git/hgcheckout/ openlugaru-debian/.git/
      $ cp lugaru-hg-git/.git/FETCH_HEAD openlugaru-debian/.git/
      $ cp -r lugaru-hg-git/.git/refs/remotes/hg openlugaru-debian/.git/refs/remotes

 iiv. Setup our local master branch to track the remote mercurial master branch
      $ git remote add hg .git/hgremote
      $ git checkout master
      $ git-hg pull

 iv. Merge master into data
     $ git branch data origin/data
     $ git checkout data
     $ git merge master

 v. Merge data into debian_data
    $ git branch debian_data origin/debian_data
    $ git checkout debian_data
    $ git merge data


3. QUILT
This package uses quilt to manage all modifications to the upstream
source.  Changes are stored in the source package as diffs in
debian/patches and applied during the build.

On Debian systems with quilt installed, further documentation is available in
`/usr/share/doc/quilt/README.source'
