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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 scm = self.make_scm() | 245 scm = self.make_scm() |
246 scm.find_checkout_root = lambda path: '' | 246 scm.find_checkout_root = lambda path: '' |
247 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000' | 247 scm._run_git = lambda args: 'Date: 2013-02-08 08:05:49 +0000' |
248 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T08:05:49Z') | 248 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T08:05:49Z') |
249 | 249 |
250 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130' | 250 scm._run_git = lambda args: 'Date: 2013-02-08 01:02:03 +0130' |
251 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-07T23:32:03Z') | 251 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-07T23:32:03Z') |
252 | 252 |
253 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800' | 253 scm._run_git = lambda args: 'Date: 2013-02-08 01:55:21 -0800' |
254 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T09:55:21Z') | 254 self.assertEqual(scm.timestamp_of_revision('some-path', '12345'), '2013-
02-08T09:55:21Z') |
| 255 |
| 256 def test_unstaged_files(self): |
| 257 scm = self.make_scm() |
| 258 status_lines = [ |
| 259 ' M d/modified.txt', |
| 260 ' D d/deleted.txt', |
| 261 '?? d/untracked.txt', |
| 262 'D d/deleted.txt', |
| 263 'M d/modified-staged.txt', |
| 264 'A d/added-staged.txt', |
| 265 ] |
| 266 # pylint: disable=protected-access |
| 267 scm._run_git = lambda args: '\x00'.join(status_lines) + '\x00' |
| 268 self.assertEqual( |
| 269 scm.unstaged_changes(), |
| 270 { |
| 271 'd/modified.txt': 'M', |
| 272 'd/deleted.txt': 'D', |
| 273 'd/untracked.txt': '?', |
| 274 }) |
OLD | NEW |