mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
Avoid surfacing error when {hg, sl} status
fails
Summary: `hg status` fails when a checkout is currently in progress. Instead of surfacing this error to the user, we should just silently log it and wait for the checkout to finish. After the checkout finishes, `hg status` is reran automatically and should succeed. Reviewed By: evangrayk Differential Revision: D42866406 fbshipit-source-id: fc0a61a20348ec29bfd88acf1853ec6c43e2ab47
This commit is contained in:
parent
2d27036226
commit
645f888a4a
@ -514,6 +514,12 @@ export class Repository {
|
||||
this.uncommittedChangesEmitter.emit('change', this.uncommittedChanges);
|
||||
} catch (err) {
|
||||
this.logger.error('Error fetching files: ', err);
|
||||
if (isProcessError(err)) {
|
||||
if (err.stderr.includes('checkout is currently in progress')) {
|
||||
this.logger.info('Ignoring `hg status` error caused by in-progress checkout');
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.uncommittedChangesEmitter.emit('error', err as Error);
|
||||
}
|
||||
});
|
||||
@ -872,3 +878,7 @@ export function absolutePathForFileInRepo(
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function isProcessError(s: any): s is {stderr: string} {
|
||||
return s != null && typeof s === 'object' && 'stderr' in s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user