summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xunperish18
1 files changed, 18 insertions, 0 deletions
diff --git a/unperish b/unperish
index f884422..78307e7 100755
--- a/unperish
+++ b/unperish
@@ -74,6 +74,8 @@ class Unperish(cliapp.Application):
self.settings.string(['upstream-version'],
'upstream version for project')
+ self.settings.boolean(['use-uncommitted'], 'use uncommited changes')
+
self.settings.config_files += ['project.meta']
def process_args(self, args):
@@ -191,6 +193,14 @@ class Unperish(cliapp.Application):
logging.debug('Does not already exist: %s' % filename)
return False
+ def cmd_committed(self, args):
+ '''Check that all changes have been committed.'''
+
+ if not self.settings['use-uncommitted']:
+ out = self.runcmd(['bzr', 'status'])
+ if out:
+ raise cliapp.AppException('Uncommitted changes:\n\n%s' % out)
+
def cmd_dget(self, args):
'''Retrieve a Debian source package (.dsc and other files).
@@ -208,11 +218,19 @@ class Unperish(cliapp.Application):
def cmd_export(self, args):
'''Export unpacked source directory to build area.'''
+ self.run_subcommand('committed')
if not self.already_exists(self.join(self.dirname)):
self.runcmd(['bzr', 'export', self.join(self.dirname)])
+ if self.settings['use-uncommitted']:
+ out = self.runcmd(['bzr', 'status', '--versioned', '--short'])
+ for line in out.splitlines():
+ status, name = line.split()
+ target = self.join(self.dirname, name)
+ shutil.copy2(name, target)
def cmd_debian_tarball(self, args):
'''Generate Debian tarball (.orig.tar.gz) in build area.'''
+ self.run_subcommand('committed')
origtar = self.join(self.debian_tarball)
if not self.already_exists(origtar):
self.runcmd(['bzr', 'export', origtar])