1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 from subprocess
import CalledProcessError
10 from mozversioncontrol
import get_repository_object
17 hg commit -m "second commit"
28 git commit -m "second commit"
37 def test_update(repo
):
38 vcs
= get_repository_object(repo
.dir)
41 repo
.execute_next_step()
49 assert vcs
.head_ref
== rev0
52 assert vcs
.head_ref
== rev1
54 # Update should fail with dirty working directory.
55 repo
.execute_next_step()
56 with pytest
.raises(CalledProcessError
):
59 assert vcs
.head_ref
== rev1
62 if __name__
== "__main__":