| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2009 Apple Inc. All rights reserved. | 2 # Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. | 3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | 30 |
| 31 import atexit | 31 import atexit |
| 32 import os | 32 import os |
| 33 import shutil | 33 import shutil |
| 34 import unittest |
| 34 | 35 |
| 35 from webkitpy.common.system.executive import Executive, ScriptError | 36 from webkitpy.common.system.executive import Executive, ScriptError |
| 36 from webkitpy.common.system.executive_mock import MockExecutive | 37 from webkitpy.common.system.executive_mock import MockExecutive |
| 37 from webkitpy.common.system.filesystem import FileSystem | 38 from webkitpy.common.system.filesystem import FileSystem |
| 38 from webkitpy.common.system.filesystem_mock import MockFileSystem | 39 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| 39 from webkitpy.common.checkout.scm.detection import detect_scm_system | 40 from webkitpy.common.checkout.scm.detection import detect_scm_system |
| 40 from webkitpy.common.checkout.scm.git import Git, AmbiguousCommitError | 41 from webkitpy.common.checkout.scm.git import Git, AmbiguousCommitError |
| 41 from webkitpy.common.checkout.scm.scm import SCM | 42 from webkitpy.common.checkout.scm.scm import SCM |
| 42 from webkitpy.common.checkout.scm.svn import SVN | 43 from webkitpy.common.checkout.scm.svn import SVN |
| 43 import webkitpy.thirdparty.unittest2 as unittest | |
| 44 | 44 |
| 45 | 45 |
| 46 # We cache the mock SVN repo so that we don't create it again for each call to a
n SVNTest or GitTest test_ method. | 46 # We cache the mock SVN repo so that we don't create it again for each call to a
n SVNTest or GitTest test_ method. |
| 47 # We store it in a global variable so that we can delete this cached repo on exi
t(3). | 47 # We store it in a global variable so that we can delete this cached repo on exi
t(3). |
| 48 original_cwd = None | 48 original_cwd = None |
| 49 cached_svn_repo_path = None | 49 cached_svn_repo_path = None |
| 50 | 50 |
| 51 @atexit.register | 51 @atexit.register |
| 52 def delete_cached_svn_repo_at_exit(): | 52 def delete_cached_svn_repo_at_exit(): |
| 53 if cached_svn_repo_path: | 53 if cached_svn_repo_path: |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 scm = self.make_scm() | 694 scm = self.make_scm() |
| 695 scm.find_checkout_root = lambda path: '' | 695 scm.find_checkout_root = lambda path: '' |
| 696 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000' | 696 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000' |
| 697 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T08:05:49Z') | 697 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T08:05:49Z') |
| 698 | 698 |
| 699 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130' | 699 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130' |
| 700 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-07T23:32:03Z') | 700 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-07T23:32:03Z') |
| 701 | 701 |
| 702 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800' | 702 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800' |
| 703 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T09:55:21Z') | 703 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T09:55:21Z') |
| OLD | NEW |