forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1676533 - Consult the base revision for file hashes instead of th…
…e on-disk files in `mach artifact` r=ahal This enables `mach artifact` and `mach bootstrap` to not fail due to local changes. Differential Revision: https://phabricator.services.mozilla.com/D96892
- Loading branch information
Ricky Stewart
committed
Nov 16, 2020
1 parent
80afb8d
commit f3bfd6f
Showing
4 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from __future__ import absolute_import | ||
|
||
import mozunit | ||
|
||
from mozversioncontrol import get_repository_object | ||
|
||
STEPS = { | ||
"hg": [ | ||
""" | ||
echo "foo" > bar | ||
""", | ||
""" | ||
hg commit -m "Updated bar" | ||
""", | ||
], | ||
"git": [ | ||
""" | ||
echo "foo" > bar | ||
""", | ||
""" | ||
git commit -am "Updated bar" | ||
""", | ||
], | ||
} | ||
|
||
|
||
def test_file_content(repo): | ||
vcs = get_repository_object(repo.strpath) | ||
head_ref = vcs.head_ref | ||
assert vcs.get_file_content("foo") == b"foo\n" | ||
assert vcs.get_file_content("bar") == b"bar\n" | ||
next(repo.step) | ||
assert vcs.get_file_content("foo") == b"foo\n" | ||
assert vcs.get_file_content("bar") == b"bar\n" | ||
next(repo.step) | ||
assert vcs.get_file_content("foo") == b"foo\n" | ||
assert vcs.get_file_content("bar") == b"foo\n" | ||
assert vcs.get_file_content("bar", revision=head_ref) == b"bar\n" | ||
|
||
|
||
if __name__ == "__main__": | ||
mozunit.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters