Skip to content

Commit 49cc5d2

Browse files
authored
fix(jest-changed-files): improve changedFilesWithAncestor command pattern for Mercurial SCM (#12322)
1 parent f60f84e commit 49cc5d2

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
- `[expect]` Throw useful error if `expect.extend` is called with invalid matchers ([#12488](https://github.com/facebook/jest/pull/12488))
6969
- `[expect]` Fix `iterableEquality` ignores other properties ([#8359](https://github.com/facebook/jest/pull/8359))
7070
- `[expect]` Fix print for the `closeTo` matcher ([#12626](https://github.com/facebook/jest/pull/12626))
71+
- `[jest-changed-files]` Improve `changedFilesWithAncestor` pattern for Mercurial SCM ([#12322](https://github.com/facebook/jest/pull/12322))
7172
- `[jest-circus, @jest/types]` Disallow undefined value in `TestContext` type ([#12507](https://github.com/facebook/jest/pull/12507))
7273
- `[jest-config]` Correctly detect CI environment and update snapshots accordingly ([#12378](https://github.com/facebook/jest/pull/12378))
7374
- `[jest-config]` Pass `moduleTypes` to `ts-node` to enforce CJS when transpiling ([#12397](https://github.com/facebook/jest/pull/12397))

Diff for: e2e/__tests__/jestChangedFiles.test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,6 @@ test('handles a bad revision for "changedSince", for git', async () => {
362362
});
363363

364364
testIfHg('gets changed files for hg', async () => {
365-
if (process.env.CI) {
366-
// Circle and Travis have very old version of hg (v2, and current
367-
// version is v4.2) and its API changed since then and not compatible
368-
// any more. Changing the SCM version on CIs is not trivial, so we'll just
369-
// skip this test and run it only locally.
370-
return;
371-
}
372-
373365
// file1.txt is used to make a multi-line commit message
374366
// with `hg commit -l file1.txt`.
375367
// This is done to ensure that `changedFiles` only returns files

Diff for: packages/jest-changed-files/src/hg.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const adapter: SCMAdapter = {
1818

1919
const args = ['status', '-amnu'];
2020
if (options.withAncestor) {
21-
args.push('--rev', 'min((!public() & ::.)+.)^');
21+
args.push('--rev', 'first(min(!public() & ::.)^+.^)');
2222
} else if (options.changedSince) {
2323
args.push('--rev', `ancestor(., ${options.changedSince})`);
2424
} else if (options.lastCommit === true) {

0 commit comments

Comments
 (0)