diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-07-09 10:52:36 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-11-14 14:22:10 +0200 |
commit | 4e1f6817919effbd2eb9a4bc218fac5041445440 (patch) | |
tree | 1a2082973d83ab533490ee3598f76da6c1ee516f | |
parent | 654385a2cc173c4199db78f4be7b54de934d8e05 (diff) | |
download | git-buildpackage-4e1f6817919effbd2eb9a4bc218fac5041445440.tar.gz git-buildpackage-4e1f6817919effbd2eb9a4bc218fac5041445440.tar.bz2 git-buildpackage-4e1f6817919effbd2eb9a4bc218fac5041445440.zip |
buildpackage: new "working copy" choices for --git-export
Add support for building different kind of "working copies", when using
the --git-export option:
- 'WC.TRACKED': only use files that are already tracked
- 'WC.UNTRACKED': use untracked files, too
- 'WC.IGNORED': also add files that'd normally be ignored
Using '--git-export=WC' beaves like before.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-x | gbp/scripts/buildpackage.py | 8 | ||||
-rw-r--r-- | gbp/scripts/common/buildpackage.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 38e5a75d..c03d39f0 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -35,7 +35,7 @@ from gbp.deb.upstreamsource import DebianUpstreamSource from gbp.errors import GbpError import gbp.log import gbp.notifications -from gbp.scripts.common.buildpackage import (index_name, wc_name, +from gbp.scripts.common.buildpackage import (index_name, wc_names, git_archive_submodules, git_archive_single, dump_tree, write_wc, drop_index) @@ -122,8 +122,10 @@ def write_tree(repo, options): if options.export_dir: if options.export == index_name: tree = repo.write_tree() - elif options.export == wc_name: - tree = write_wc(repo) + elif options.export in wc_names: + tree = write_wc(repo, + force=wc_names[options.export]['force'], + untracked=wc_names[options.export]['untracked']) else: tree = options.export if not repo.has_treeish(tree): diff --git a/gbp/scripts/common/buildpackage.py b/gbp/scripts/common/buildpackage.py index 77113f94..acb0bb19 100644 --- a/gbp/scripts/common/buildpackage.py +++ b/gbp/scripts/common/buildpackage.py @@ -31,7 +31,10 @@ import gbp.log # when we want to reference the index in a treeish context we call it: index_name = "INDEX" # when we want to reference the working copy in treeish context we call it: -wc_name = "WC" +wc_names = {'WC': {'force': True, 'untracked': True}, + 'WC.TRACKED': {'force': False, 'untracked': False}, + 'WC.UNTRACKED': {'force': False, 'untracked': True}, + 'WC.IGNORED': {'force': True, 'untracked': True}} # index file name used to export working copy wc_index = ".git/gbp_index" |