Integrate recordAll command with input box
[?]
Dec 27, 2020, 11:22 PM
MU6ZNUYZBFX4HUTJO7HEXCEJ5KTQAMCR4MUKSUDM2MYUFCEAHRDACDependencies
- [2]
JYMSJCPQAdd command to add all untracked files and fix repository refreshing - [3]
H3GAPFUCAdd pijul.recordAll command - [4]
LUFSQKUVEnable support for experimental decorators - [5]
ILH3GIVTAdd command centre and refresh/init commands - [6]
B4SKYP3YAdd repository model and add steps to initialize it - [7]
YUVLBWV3Populate resource groups for unrecorded and untracked changes - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI - [*]
NCBEWRYEInitialize Repository
Change contents
- replacement in src/repository.ts at line 1
import { Disposable, OutputChannel, scm, SourceControl, SourceControlResourceGroup, Uri } from 'vscode';import { Disposable, OutputChannel, scm, SourceControl, SourceControlResourceGroup, Uri, window } from 'vscode'; - replacement in src/repository.ts at line 19
this.sourceControl.acceptInputCommand = { command: 'pijul.record', title: 'record', arguments: [this.sourceControl] };this.sourceControl.acceptInputCommand = { command: 'pijul.recordAll', title: 'record', arguments: [this.sourceControl] }; - replacement in src/repository.ts at line 24
// TODO: Set input box placeholder// Set the input box placeholder to match the hotkeyif (process.platform === 'darwin') {this.sourceControl.inputBox.placeholder = 'Message (press Cmd+Enter to record a change)';} else {this.sourceControl.inputBox.placeholder = 'Message (press Ctrl+Enter to record a change)';} - replacement in src/repository.ts at line 61
async recordAllChanges (message: string): Promise<void> {await this.repository.recordAllChanges(message);async recordAllChanges (message? : string): Promise<void> {if (!message) {message = this.sourceControl.inputBox.value;// Clear messagethis.sourceControl.inputBox.value = '';if (!message) {message = await window.showInputBox({placeHolder: 'Change Message',prompt: 'Please include a message describing what has changed',ignoreFocusOut: true});}}if (message) {await this.repository.recordAllChanges(message);} else {window.showErrorMessage('Change was not recorded, no message was provided');} - edit in src/repository.ts at line 90
}/*** Reset all files in the repository by undoing recorded changes*/async resetAll (): Promise<void> {await this.repository.resetAll(); - edit in src/pijul.ts at line 233
/*** Reset all files in the repository by undoing recorded changes*/async resetAll (): Promise<void> {await this._pijul.exec(this.repositoryRoot, ['reset']);} - replacement in src/commands.ts at line 132
// TODO: Get message from input boxconst message = await window.showInputBox({placeHolder: 'Change Message',prompt: 'Please include a message describing what has changed',ignoreFocusOut: true});if (message) {repository.recordAllChanges(message);} else {window.showErrorMessage('Change was not recorded, no message was provided');}await repository.recordAllChanges(); - edit in src/commands.ts at line 143
await repository.refreshStatus();}/*** Resets the repository, discarding unrecorded changes* @param repository The repository that will be reset*/@command('pijul.resetAll', { repository: true })async resetAll (repository: Repository): Promise<void> {await repository.resetAll(); - edit in package.json at line 44[2.1120][10.108628]
},{"command": "pijul.resetAll","title": "Reset All Unrecorded Changes","category": "Pijul"