summaryrefslogtreecommitdiff
path: root/subplot/bumper.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-05 08:48:46 +0000
committerLars Wirzenius <liw@liw.fi>2021-04-05 08:48:46 +0000
commit079357cc06488433afd1feac6ca41d859fbdee00 (patch)
tree9b3e746ba6d523c080f0f40b5c0798f7e9326da5 /subplot/bumper.py
parent62e5bf8eca44deec7f45bb697ee98298b8abd219 (diff)
parent19cb8fcd22e9d2bc240cbd2b23efa2e19cf7ea52 (diff)
downloadbumper-rs-079357cc06488433afd1feac6ca41d859fbdee00.tar.gz
Merge branch 'cargo-lock-update' into 'main'
feat: update Cargo.lock int Rust projects See merge request larswirzenius/bumper!10
Diffstat (limited to 'subplot/bumper.py')
-rw-r--r--subplot/bumper.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/subplot/bumper.py b/subplot/bumper.py
index e340927..3edad5e 100644
--- a/subplot/bumper.py
+++ b/subplot/bumper.py
@@ -94,3 +94,17 @@ def git_working_tree_is_clean(ctx, dirname=None):
runcmd_exit_code_is_zero(ctx)
output = runcmd_get_stdout(ctx)
assert_eq(output, "")
+
+
+def file_is_newer_than_other_file(ctx, file1=None, file2=None):
+ assert os.path.getmtime(file1) > os.path.getmtime(file2)
+
+
+def file_is_in_git(ctx, filename=None):
+ runcmd_run = globals()["runcmd_run"]
+ runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+
+ dirname = os.path.dirname(filename) or "."
+ basename = os.path.basename(filename)
+ runcmd_run(ctx, ["git", "blame", basename], cwd=dirname)
+ runcmd_exit_code_is_zero(ctx)