Repository: buildbot/buildbot

Issue:
Replace client.getPage() with 
twisted.web.client.getPage was deprecated in Twisted 16.7.0.

http://docs.buildbot.net/current/developer/utils.html#buildbot.util.service.HTTPClientService
should be used instead


Discussion:

Resolving patch:
diff --git a/master/buildbot/changes/hgpoller.py b/master/buildbot/changes/hgpoller.py
--- a/master/buildbot/changes/hgpoller.py
+++ b/master/buildbot/changes/hgpoller.py
@@ -284,7 +284,7 @@ def _processChanges(self, unused_output):
                 revision=unicode(node),
                 files=files,
                 comments=comments,
-                when_timestamp=int(timestamp),
+                when_timestamp=int(timestamp) if timestamp else None,
                 branch=ascii2unicode(self.branch),
                 category=ascii2unicode(self.category),
                 project=ascii2unicode(self.project),
diff --git a/master/setup.py b/master/setup.py
--- a/master/setup.py
+++ b/master/setup.py
@@ -482,7 +482,7 @@ def define_plugin_entries(groups):
             'idna >= 0.6',
         ],
         'docs': [
-            'sphinx',
+            'sphinx==1.4.3',
             'sphinxcontrib-blockdiag',
             'sphinxcontrib-spelling',
             'pyenchant',


Test patch:
diff --git a/master/buildbot/test/unit/test_changes_hgpoller.py b/master/buildbot/test/unit/test_changes_hgpoller.py
--- a/master/buildbot/test/unit/test_changes_hgpoller.py
+++ b/master/buildbot/test/unit/test_changes_hgpoller.py
@@ -27,6 +27,7 @@
 class TestHgPoller(gpo.GetProcessOutputMixin,
                    changesource.ChangeSourceMixin,
                    unittest.TestCase):
+    usetimestamps = True
 
     def setUp(self):
         # To test that environment variables get propagated to subprocesses
@@ -43,6 +44,7 @@ def _isRepositoryReady():
 
         def create_poller(_):
             self.poller = hgpoller.HgPoller(self.remote_repo,
+                                            usetimestamps=self.usetimestamps,
                                             workdir='/some/dir')
             self.poller.setServiceParent(self.master)
             self.poller._isRepositoryReady = _isRepositoryReady
@@ -122,7 +124,10 @@ def check_changes(_):
             self.assertEqual(change['revision'], '4423cdb')
             self.assertEqual(change['author'],
                              'Bob Test <bobtest@example.org>')
-            self.assertEqual(change['when_timestamp'], 1273258100),
+            if self.usetimestamps:
+                self.assertEqual(change['when_timestamp'], 1273258100)
+            else:
+                self.assertEqual(change['when_timestamp'], None)
             self.assertEqual(
                 change['files'], ['file1 with spaces', os.path.join('dir with spaces', 'file2')])
             self.assertEqual(change['src'], 'hg')
@@ -193,3 +198,9 @@ def check_changes(_):
             self.assertEqual(change['revision'], u'784bd')
             self.assertEqual(change['comments'], u'Comment for rev 5')
         d.addCallback(check_changes)
+
+
+class HgPollerNoTimestamp(TestHgPoller):
+    """ Test HgPoller() without parsing revision commit timestamp """
+
+    usetimestamps = False