@staticmethod
def html_dump_header(title):
nowdate=time.strftime("%Y-%m-%d")
- nowtime=time.strftime("%H:%M")
+ nowtime=time.strftime("%H:%M (%Z)")
print """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
##############################
class Package:
- def __init__(self, package, module, svnpath, spec):
+ def __init__(self, package, module, svnpath, spec,options):
self.package=package
self.module=module
self.svnrev = None
if self.svnrev:
self.specpath += "@%s" % self.svnrev
self.basename=os.path.basename(svnpath)
+ self.options=options
# returns a http URL to the trac path where full diff can be viewed (between self and pkg)
# typically http://svn.planet-lab.org/changeset?old_path=Monitor%2Ftags%2FMonitor-1.0-7&new_path=Monitor%2Ftags%2FMonitor-1.0-13
return "%s://%s/changeset?old_path=%s&new_path=%s"%(method,hostname,self_path,pkg_path)
else:
return None
+
+ def inline_full_diff (self, pkg):
+ print '{{{'
+ command='svn diff %s %s'%(self.svnpath,pkg.svnpath)
+ Command(command,self.options).run()
+ print '}}}'
def details (self):
return "[%s %s] [%s (spec)]"%(self.svnpath,self.basename,self.specpath)
# we cannot get build's svnpath as for other packages as we'd get something in svn+ssh
# xxx quick & dirty
- def __init__ (self, buildtag,options):
+ def __init__ (self, buildtag, options):
self.buildtag=buildtag
+ if buildtag == "trunk":
+ module_name="build"
+ self.display="trunk"
+ self.svnpath="http://svn.planet-lab.org/svn/build/trunk"
# if the buildtag start with a : (to use a branch rather than a tag)
- if buildtag.find(':') == 0 :
+ elif buildtag.find(':') == 0 :
module_name="build%(buildtag)s"%locals()
self.display=buildtag[1:]
self.svnpath="http://svn.planet-lab.org/svn/build/branches/%s"%self.display
make_options="--no-print-directory -C %s stage1=true PLDISTRO=%s PLDISTROTAGS=%s 2> /dev/null"%(self.edge_dir(),distro,distrotag)
command="make %s packages"%make_options
make_packages=Command(command,self.options).output_of()
+ if self.options.verbose:
+ print 'obtaining packages information with command:'
+ print command
pkg_line=re.compile("\Apackage=(?P<package>[^\s]+)\s+ref_module=(?P<module>[^\s]+)\s.*\Z")
for line in make_packages.split("\n"):
if not line:
svnpath=Command(command,self.options).output_of().strip()
command="make %s +%s-SPEC"%(make_options,package)
spec=Command(command,self.options).output_of().strip()
- result[package]=Package(package,module,svnpath,spec)
+ result[module]=Package(package,module,svnpath,spec,self.options)
return result
def get_distrotags (self):
# parse make packages
packages_new=build_new.get_packages(distrotag)
pnames_new=set(packages_new.keys())
- if options.verbose: print 'got packages for ',build_new.display
packages_old=build_old.get_packages(distrotag)
pnames_old=set(packages_old.keys())
- if options.verbose: print 'got packages for ',build_old.display
- # get created, deprecated, and preserved package names
+ # get names of created, deprecated, and preserved modules
pnames_created = list(pnames_new-pnames_old)
- pnames_created.sort()
pnames_deprecated = list(pnames_old-pnames_new)
- pnames_deprecated.sort()
pnames = list(pnames_new.intersection(pnames_old))
+
+ pnames_created.sort()
+ pnames_deprecated.sort()
pnames.sort()
- if options.verbose: print "Found new/deprecated/preserved pnames",pnames_new,pnames_deprecated,pnames
+ if options.verbose:
+ print '--------------------'
+ print 'got packages for ',build_new.display
+ print pnames_new
+ print '--------------------'
+ print 'got packages for ',build_old.display
+ print pnames_old
+ print '--------------------'
+ print "Found new modules",pnames_created
+ print '--------------------'
+ print "Found deprecated modules",pnames_deprecated
+ print '--------------------'
+ print "Found preserved modules",pnames
+ print '--------------------'
# display created and deprecated
for name in pnames_created:
print '=== %s - %s to %s : package %s === #package-%s-%s-%s'%(
distrotag,build_old.display,build_new.display,name,name,distro,build_new.display)
print ' * from %s to %s'%(pobj_old.details(),pobj_new.details())
- trac_diff_url=pobj_old.trac_full_diff(pobj_new)
- if trac_diff_url:
- print ' * [%s View full diff]'%trac_diff_url
- print '{{{'
- for line in specdiff.split('\n'):
- if not line:
- continue
- if Release.discard_matcher.match(line):
- continue
- if line[0] in ['@']:
- print '----------'
- elif line[0] in ['+','-']:
- print_fold(line)
- print '}}}'
+ if options.inline_diff:
+ pobj_old.inline_full_diff(pobj_new)
+ else:
+ trac_diff_url=pobj_old.trac_full_diff(pobj_new)
+ if trac_diff_url:
+ print ' * [%s View full diff]'%trac_diff_url
+ else:
+ print ' * No full diff available'
+ print '{{{'
+ for line in specdiff.split('\n'):
+ if not line:
+ continue
+ if Release.discard_matcher.match(line):
+ continue
+ if line[0] in ['@']:
+ print '----------'
+ elif line[0] in ['+','-']:
+ print_fold(line)
+ print '}}}'
##############################
class Main:
release-changelog 4.2-rc25 4.2-rc24 4.2-rc23 4.2-rc22
You can refer to a (build) branch by prepending a colon, like in
release-changelog :4.2 4.2-rc25
+ You can refer to the build trunk by just mentioning 'trunk', e.g.
+ release-changelog -t coblitz-tags.mk coblitz-2.01-rc6 trunk
"""
common_usage="""More help:
see http://svn.planet-lab.org/wiki/ModuleTools"""
break
if not mode:
print "Unsupported command",sys.argv[0]
- print "Supported commands:" + Modes.modes.keys.join(" ")
+ print "Supported commands:" + " ".join(Main.modes.keys())
sys.exit(1)
if mode not in Main.release_modes:
else:
parser.add_option("-n","--dry-run",action="store_true",dest="dry_run",default=False,
help="dry run - shell commands are only displayed")
+ parser.add_option("-i","--inline-diff",action="store_true",dest="inline_diff",default=False,
+ help="calls svn diff on whole module, not just only the spec file")
parser.add_option("-t","--distrotags",action="callback",callback=Main.optparse_list, dest="distrotags",
default=[], nargs=1,type="string",
help="""specify distro-tags files, e.g. onelab-tags-4.2.mk