[Buildbot-commits] buildbot/buildbot/test test_svnpoller.py, 1.5, 1.6

Brian Warner warner at users.sourceforge.net
Tue May 27 00:52:15 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11429/buildbot/test

Modified Files:
	test_svnpoller.py 
Log Message:
[project @ #261:buildbot_branch_deletions.diff]
Patch by Neil Hemingway <neil.hemingway at googlemail.com> that has
svnpoller checking whether the change reported by SVN is a branch
deletion. If it is, a buildbot Change is not created.

Original author: dustin at v.igoro.us
Date: 2008-05-16 20:45:12+00:00

Index: test_svnpoller.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_svnpoller.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- test_svnpoller.py	30 Mar 2008 01:30:00 -0000	1.5
+++ test_svnpoller.py	27 May 2008 00:52:13 -0000	1.6
@@ -117,7 +117,33 @@
 # output from svn log on .../SVN-Repository/sample
 # (so it includes trunk and branches)
 sample_base = "file:///usr/home/warner/stuff/Projects/BuildBot/trees/misc/_trial_temp/test_vc/repositories/SVN-Repository/sample"
-sample_logentries = [None] * 4
+sample_logentries = [None] * 6
+
+sample_logentries[5] = """\
+<logentry
+   revision="6">
+<author>warner</author>
+<date>2006-10-01T19:35:16.165664Z</date>
+<paths>
+<path
+   action="D">/sample/branch/version.c</path>
+</paths>
+<msg>revised_to_2</msg>
+</logentry>
+"""
+
+sample_logentries[4] = """\
+<logentry
+   revision="5">
+<author>warner</author>
+<date>2006-10-01T19:35:16.165664Z</date>
+<paths>
+<path
+   action="D">/sample/branch</path>
+</paths>
+<msg>revised_to_2</msg>
+</logentry>
+"""
 
 sample_logentries[3] = """\
 <logentry
@@ -293,6 +319,27 @@
         self.failUnlessEqual(changes[0].revision, '4')
         self.failUnlessEqual(changes[0].files, ["version.c"])
 
+        # and now pull in r5 (should *not* create a change as it's a
+        # branch deletion
+        doc = s.parse_logs(make_changes_output(5))
+        newlast, logentries = s._filter_new_logentries(doc, newlast)
+        self.failUnlessEqual(newlast, 5)
+        # so we see revision 5 as being new
+        changes = s.create_changes(logentries)
+        self.failUnlessEqual(len(changes), 0)
+
+        # and now pull in r6 (should create a change as it's not
+        # deleting an entire branch
+        doc = s.parse_logs(make_changes_output(6))
+        newlast, logentries = s._filter_new_logentries(doc, newlast)
+        self.failUnlessEqual(newlast, 6)
+        # so we see revision 6 as being new
+        changes = s.create_changes(logentries)
+        self.failUnlessEqual(len(changes), 1)
+        self.failUnlessEqual(changes[0].branch, 'branch')
+        self.failUnlessEqual(changes[0].revision, '6')
+        self.failUnlessEqual(changes[0].files, ["version.c"])
+
     def testFirstTime(self):
         base = "file:///home/warner/stuff/Projects/BuildBot/trees/svnpoller/_trial_temp/test_vc/repositories/SVN-Repository/sample"
         s = SVNPoller(base, split_file=split_file)





More information about the Commits mailing list