Bug 48272
Summary: | REGRESSION(r70437): Git.revisions_changing_file no longer raises for non-existant files | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | abarth, dbates, ddkilzer, eric, evan, mithro, ojan |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
Bug Depends on: | 48187 | ||
Bug Blocks: |
Eric Seidel (no email)
REGRESSION(r70437): Git.revisions_changing_file no longer raises for non-existant files
test-webkitpy webkitpy.common.checkout.scm_unittest.GitSVNTest.test_revisions_changing_file
======================================================================
FAIL: test_revisions_changing_file (webkitpy.common.checkout.scm_unittest.GitSVNTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Projects/WebKit/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py", line 1237, in test_revisions_changing_file
self._shared_test_revisions_changing_file()
File "/Projects/WebKit/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py", line 357, in _shared_test_revisions_changing_file
self.assertRaises(ScriptError, self.scm.revisions_changing_file, "non_existent_file")
AssertionError: ScriptError not raised
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
% git log non_existant_file
fatal: ambiguous argument 'non_existant_file': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
% git log -- non_existant_file
however just churns for a long while and then outputs nothing and exits 0. Both of those behaviors seem bad. I wonder if there is some flag we should pass to git.
David Kilzer (:ddkilzer)
(In reply to comment #1)
> % git log non_existant_file
> fatal: ambiguous argument 'non_existant_file': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
>
> % git log -- non_existant_file
>
> however just churns for a long while and then outputs nothing and exits 0. Both of those behaviors seem bad. I wonder if there is some flag we should pass to git.
What is the code trying to do? (Sorry, don't have time to peruse it now.) Why don't you just test for the file's existence and skip running "git log" in that case?
I think "git log -- non_existant_file" may be checking the repository's history for any file that ever existed at that path.
I think some discussion about this under the "History Simplification" section in "man git-log".
This seems to run faster: git log --since="1 day ago" -- foo
Ojan Vafai
*** Bug 49948 has been marked as a duplicate of this bug. ***
Ojan Vafai
Can we do something about the failing test? Just comment out this line for now? I keep hitting this everytime I modify scm.py and it costs me some time to realize it wasn't my patch that broke it.
Tim 'mithro' Ansell
This test now passes.
$ ./test-webkitpy webkitpy.common.checkout.scm.scm_unittest.GitSVNTest.test_revisions_changing_file
Suppressing most webkitpy logging while running unit tests.
Ran 1 test in 4.752s
OK