~nacc/git-ubuntu:source_builder-file_contents

Last commit made on 2018-04-10
Get this branch:
git clone -b source_builder-file_contents https://git.launchpad.net/~nacc/git-ubuntu
Only Nish Aravamudan can upload to this branch. If you are Nish Aravamudan please log in for upload directions.

Branch merges

Branch information

Name:
source_builder-file_contents
Repository:
lp:~nacc/git-ubuntu

Recent commits

38b2ef2... by Nish Aravamudan

source_builder: add file_contents attribute to SourceSpec

This allows for arbitrary file creation in the source package, to
manipulate the Git tree contents.

Also add a unit test.

bd62529... by Nish Aravamudan

source_builder_test: fix docstrings

e11e896... by Nish Aravamudan

source_builder: add second assertion

This assertion is complementary to the other. Also add a test.

---

Originally, I had included a change that automatically set the native
variable based upon the version passed in (so you only had to specify
one of version or native), but I'm no longer confident that is what you
want the API to be. This change is sufficient to catch the issue and
ensures 100% code coverage with the test.

649ebc6... by Nish Aravamudan

git_repository: drop ensure_importer_branches_exist

Much like 1d658869b56b ("Create dsc branch on first use"), create the
pristine-tar necessary branches on first use, which all occurs within
the context manager in git_repository.py.

This should only result in one functional change, but should ensure
there are no side-effects of simply instantiating a GitUbuntuRepository
object and the helper function is no longer necessary.

The functional change is that when there is only publishing history in
one of Debian or Ubuntu, there will only be pristine-tar related
branches for the specific distribution. This requires, in turn, ensuring
that pristine_tar_list does not create any branches, so that `git ubuntu
build`'s usage continues to work as expected.

It is a separate issue as to whether these branches should exist in the
first place or not.

LP 1733895

---

1ea003b... by Nish Aravamudan

git_repository: add docstring to pristine_tar methods

3d8ed66... by Nish Aravamudan

repo_builder.SourceTree: allow for patches to be applied

353cf59... by Nish Aravamudan

dsc_to_tree_hash: add ability to get final patches-applied tree

This is needed for future tests for the patches-applied code.

50ce40e... by Nish Aravamudan

repo_builder: add Repo.copy

This will allow for importer tests to start with a given
Repo object, specify the modifications to it, and then
generate the expected result structurally. The original
and modified-copy can then be compared with the to-be-written
Repo comparator.

dfa5ff2... by Nish Aravamudan

repo_builder: specify UTC offset

9befa85... by Nish Aravamudan

repo_builder: add Branch and Tag classes

These classes are used to extend the Repo class to include their
corresponding refs.

This also requires changing when replace_placeholders is called for
Repo() objects. We want to be able to run tests against Repo() objects
which might be otherwise invalid, so we need to defer the
replace_placeholders() call until write().