summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-07-09 10:52:36 +0300
committerTzafrir Cohen <tzafrir@debian.org>2015-03-26 14:21:52 +0200
commitc769b660911de03a8bf7ffb6e22991646b486790 (patch)
tree85178854e44b993183cff36eb6fbe3912957b158
parent69f381ee9056bc7f284fd25b96180517c27776ae (diff)
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-xgbp/scripts/buildpackage.py8
-rw-r--r--gbp/scripts/common/buildpackage.py5
2 files changed, 9 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 419f01d..6a9f33b 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 7aeebe0..111512f 100644
--- a/gbp/scripts/common/buildpackage.py
+++ b/gbp/scripts/common/buildpackage.py
@@ -32,7 +32,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"