Rev 4530: Isolate some tests from TZ in http://bazaar.launchpad.net/~vila/bzr/integration

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jul 13 14:25:29 BST 2009


At http://bazaar.launchpad.net/~vila/bzr/integration

------------------------------------------------------------
revno: 4530 [merge]
revision-id: v.ladeuil+lp at free.fr-20090713132518-chkdd0rhyi2ok451
parent: pqm at pqm.ubuntu.com-20090713080805-x2kz90cdzjwdegpc
parent: v.ladeuil+lp at free.fr-20090710074315-tfbke0r54hk2af6o
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: integration
timestamp: Mon 2009-07-13 15:25:18 +0200
message:
  Isolate some tests from TZ
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/branchbuilder.py        branchbuilder.py-20070427022007-zlxpqz2lannhk6y8-1
  bzrlib/tests/test_annotate.py  test_annotate.py-20061213215015-sttc9agsxomls7q0-1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-07-13 08:08:05 +0000
+++ b/NEWS	2009-07-13 13:25:18 +0000
@@ -19,6 +19,9 @@
 Bug Fixes
 *********
 
+* BranchBuilder now accepts timezone to avoid test failures in countries far
+  from GMT. (Vincent Ladeuil, #397716)
+
 Improvements
 ************
 

=== modified file 'bzrlib/branchbuilder.py'
--- a/bzrlib/branchbuilder.py	2009-06-19 21:25:51 +0000
+++ b/bzrlib/branchbuilder.py	2009-07-10 07:43:15 +0000
@@ -162,7 +162,7 @@
 
     def build_snapshot(self, revision_id, parent_ids, actions,
         message=None, timestamp=None, allow_leftmost_as_ghost=False,
-        committer=None):
+        committer=None, timezone=None):
         """Build a commit, shaped in a specific way.
 
         :param revision_id: The handle for the new commit, can be None
@@ -177,6 +177,7 @@
             commit message will be written.
         :param timestamp: If non-None, set the timestamp of the commit to this
             value.
+        :param timezone: An optional timezone for timestamp.
         :param committer: An optional username to use for commit
         :param allow_leftmost_as_ghost: True if the leftmost parent should be
             permitted to be a ghost.
@@ -243,7 +244,7 @@
             for file_id, content in new_contents.iteritems():
                 tree.put_file_bytes_non_atomic(file_id, content)
             return self._do_commit(tree, message=message, rev_id=revision_id,
-                timestamp=timestamp, committer=committer)
+                timestamp=timestamp, timezone=timezone, committer=committer)
         finally:
             tree.unlock()
 

=== modified file 'bzrlib/tests/test_annotate.py'
--- a/bzrlib/tests/test_annotate.py	2009-06-19 21:32:28 +0000
+++ b/bzrlib/tests/test_annotate.py	2009-07-10 07:43:15 +0000
@@ -182,16 +182,16 @@
         builder.build_snapshot('rev-1', None, [
             ('add', ('', 'root-id', 'directory', None)),
             ('add', ('a', 'a-id', 'file', 'first\n')),
-            ], timestamp=1166046000.00, committer="joe at foo.com")
+            ], timestamp=1166046000.00, timezone=0, committer="joe at foo.com")
         builder.build_snapshot('rev-2', ['rev-1'], [
             ('modify', ('a-id', 'first\nsecond\n')),
-            ], timestamp=1166046001.00, committer="joe at foo.com")
+            ], timestamp=1166046001.00, timezone=0, committer="joe at foo.com")
         builder.build_snapshot('rev-1_1_1', ['rev-1'], [
             ('modify', ('a-id', 'first\nthird\n')),
-            ], timestamp=1166046002.00, committer="barry at foo.com")
+            ], timestamp=1166046002.00, timezone=0, committer="barry at foo.com")
         builder.build_snapshot('rev-3', ['rev-2', 'rev-1_1_1'], [
             ('modify', ('a-id', 'first\nsecond\nthird\n')),
-            ], timestamp=1166046003.00, committer="sal at foo.com")
+            ], timestamp=1166046003.00, timezone=0, committer="sal at foo.com")
         return builder
 
     def create_deeply_merged_trees(self):
@@ -222,15 +222,15 @@
         builder.build_snapshot('rev-4', ['rev-3', 'rev-1_1_2'], [])
         builder.build_snapshot('rev-1_2_1', ['rev-1_1_1'], [
             ('modify', ('a-id', 'first\nthird\nfourth\n')),
-            ], timestamp=1166046003.00, committer="jerry at foo.com")
+            ], timestamp=1166046003.00, timezone=0, committer="jerry at foo.com")
         builder.build_snapshot('rev-1_2_2', ['rev-1_2_1'], [],
-            timestamp=1166046004.00, committer="jerry at foo.com")
+            timestamp=1166046004.00, timezone=0, committer="jerry at foo.com")
         builder.build_snapshot('rev-5', ['rev-4', 'rev-1_2_2'], [
             ('modify', ('a-id', 'first\nsecond\nthird\nfourth\n')),
-            ], timestamp=1166046004.00, committer="jerry at foo.com")
+            ], timestamp=1166046004.00, timezone=0, committer="jerry at foo.com")
         builder.build_snapshot('rev-1_3_1', ['rev-1_2_1'], [
             ('modify', ('a-id', 'first\nthird\nfourth\nfifth\nsixth\n')),
-            ], timestamp=1166046005.00, committer="george at foo.com")
+            ], timestamp=1166046005.00, timezone=0, committer="george at foo.com")
         builder.build_snapshot('rev-6', ['rev-5', 'rev-1_3_1'], [
             ('modify', ('a-id',
                         'first\nsecond\nthird\nfourth\nfifth\nsixth\n')),



More information about the bazaar-commits mailing list