Author: waldi Date: Mon Jun 21 13:46:53 2010 New Revision: 776 Log: debian/bin/genorig.py: Merge some updates. Modified: trunk/xen-common/debian/bin/genorig.py Modified: trunk/xen-common/debian/bin/genorig.py =============================================================================--- trunk/xen-common/debian/bin/genorig.py Thu Jun 17 09:17:32 2010 (r775) +++ trunk/xen-common/debian/bin/genorig.py Mon Jun 21 13:46:53 2010 (r776) @@ -27,7 +27,6 @@ import tempfile self.dir = tempfile.mkdtemp(prefix=''genorig'', dir=''debian'') try: - self.do_update() self.do_version() self.orig_dir = "%s-%s" % (self.source, self.version) @@ -39,15 +38,6 @@ finally: shutil.rmtree(self.dir) - def do_update(self): - if not self.options.tag: - return - - self.log(''Updating to tag %s.\n'' % self.options.tag) - p = subprocess.Popen((''hg'', ''update'', ''-r'', self.options.tag), cwd=self.repo) - if p.wait(): - raise RuntimeError - def do_version(self): if self.options.version: self.version = self.options.version @@ -58,7 +48,7 @@ self.log("Create archive.\n") arg_dir = os.path.join(os.path.realpath(self.dir), self.orig_dir) - args = (''hg'', ''archive'', arg_dir) + tuple(itertools.chain(*((''-I'', i) for i in self.files))) + args = (''hg'', ''archive'', ''-r'', self.options.tag, arg_dir) + tuple(itertools.chain(*((''-I'', i) for i in self.files))) p = subprocess.Popen(args, cwd=self.repo) if p.wait(): raise RuntimeError @@ -67,8 +57,7 @@ self.log("Exporting changelog.\n") log = open("%s/%s/Changelog" % (self.dir, self.orig_dir), ''w'') - - args = (''hg'', ''log'') + tuple(self.files) + args = (''hg'', ''log'', ''-r'', ''%s:0'' % self.options.tag) + tuple(self.files) p = subprocess.Popen(args, cwd=self.repo, stdout=log) if p.wait(): raise RuntimeError @@ -86,7 +75,7 @@ if __name__ == ''__main__'': from optparse import OptionParser p = OptionParser(prog=sys.argv[0], usage=''%prog [OPTION]... DIR'') - p.add_option("-t", "--tag", dest="tag") + p.add_option("-t", "--tag", dest="tag", default=''tip'') p.add_option("-v", "--version", dest="version") options, args = p.parse_args() if len(args) != 1: