get rid of extra prints
[build.git] / module-tools.py
index 8a7a51f..3def09f 100755 (executable)
@@ -1000,7 +1000,7 @@ will be based on latest tag %s and *not* on the current trunk"""%(self.name,bran
         self.run_prompt("Commit trunk",command)
         # create initial tag for the new trunk
         new_tag_url=self.tag_url(spec_dict)
-        command="svn copy --file %s %s %s"%(tmp,self.edge_url(),new_tag_url)
+        command="svn copy --file %s %s %s"%(tmp,tag_url,new_tag_url)
         self.run_prompt("Create initial tag in trunk",command)
         os.unlink(tmp)
         # print message about SVNBRANCH
@@ -1014,9 +1014,14 @@ class Package:
     def __init__(self, package, module, svnpath, spec):
         self.package=package
         self.module=module
-        self.svnpath=svnpath
+        self.svnrev = None
+        self.svnpath=svnpath    
+        if svnpath.rfind('@') > 0:
+            self.svnpath, self.svnrev = svnpath.split('@')
         self.spec=spec
-        self.specpath="%s/%s"%(svnpath,spec)
+        self.specpath="%s/%s"%(self.svnpath,self.spec)
+        if self.svnrev:
+            self.specpath += "@%s" % self.svnrev
         self.basename=os.path.basename(svnpath)
 
     # returns a http URL to the trac path where full diff can be viewed (between self and pkg)
@@ -1041,10 +1046,14 @@ class Build (Module):
     
     # 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
@@ -1168,7 +1177,10 @@ class Release:
             pnames = list(pnames_new.intersection(pnames_old))
             pnames.sort()
 
-            if options.verbose: print "Found new/deprecated/preserved pnames",pnames_new,pnames_deprecated,pnames
+            if options.verbose: 
+                print "Found new pnames",pnames_new
+                print "Found deprecated pnames",pnames_deprecated
+                print "Found preserved pnames",pnames
 
             # display created and deprecated 
             for name in pnames_created:
@@ -1222,6 +1234,8 @@ class Release:
 class Main:
 
     module_usage="""Usage: %prog [options] module_desc [ .. module_desc ]
+Revision: $Revision$
+
 module-tools : a set of tools to manage subversion tags and specfile
   requires the specfile to either
   * define *version* and *taglevel*
@@ -1240,6 +1254,8 @@ Branches:
       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"""