forked from facebook/watchman
-
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.
Add scm method to get source control date
Summary: Add a method to the existing SCM abstraction so we can get the source control date for a given commit hash. Reviewed By: wez Differential Revision: D8224127 fbshipit-source-id: 7de51cb8eb502253b2b890905b63fbfd3bd27522
- Loading branch information
1 parent
ed6049e
commit 3d2c032
Showing
6 changed files
with
84 additions
and
0 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
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,22 @@ | ||
/* Copyright 2016-present Facebook, Inc. | ||
* Licensed under the Apache License, Version 2.0. */ | ||
|
||
#include "scm/Mercurial.h" | ||
#include "thirdparty/tap.h" | ||
#include "watchman.h" | ||
|
||
using namespace std::chrono; | ||
|
||
void test_convert_date() { | ||
auto date = watchman::Mercurial::convertCommitDate("1529420960.025200"); | ||
auto result = duration_cast<seconds>(date.time_since_epoch()).count(); | ||
auto expected = 1529420960; | ||
ok(result == expected, "Expected %d but observed %d", expected, result); | ||
} | ||
|
||
int main(int, char**) { | ||
plan_tests(1); | ||
test_convert_date(); | ||
|
||
return exit_status(); | ||
} |
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