1. Robot Mirror
  2. bugs.python.org

Commits

martin.v.loewis  committed e9b8e6c

Restrict output if not verbose.
Ignore detached patches.

  • Participants
  • Parent commits 7f5457f
  • Branches default

Comments (0)

Files changed (1)

File scripts/addpatchsets

View file
 #!/usr/bin/python
-import sys, os, urllib2
+import sys, os, urllib2, logging
 basedir = os.path.dirname(os.path.dirname(__file__))
 sys.path.append(basedir+"/rietveld")
 os.environ["DJANGO_SETTINGS_MODULE"]="settings"
 verbose = False
 if len(sys.argv)==2 and sys.argv[1]=='-v':
     verbose=True
+else:
+    logging.disable(logging.ERROR)
 
 from codereview.models import (Repository, Branch, Patch, 
                                PatchSet, Issue, Content)
           order_by('id')):
     c.execute("select nodeid from issue_files where linkid=%s", (f.id,))
     nodeid = c.fetchone()[0]
+    nodeid = c.fetchone()
+    if not nodeid:
+        if verbose:
+            print "File",nodeid,"is detached"
+        continue
+    nodeid = nodeid[0]
     roundup = RoundupIssue.objects.get(id=nodeid)
     if roundup._status == closed:
-        print "issue",nodeid,"is closed"
+        if verbose:
+            print "issue",nodeid,"is closed"
         continue
     issue = Issue.objects.filter(id=nodeid)
     if not issue: