Integrate recordAll command with input box

[?]
Dec 27, 2020, 11:22 PM
MU6ZNUYZBFX4HUTJO7HEXCEJ5KTQAMCR4MUKSUDM2MYUFCEAHRDAC

Dependencies

  • [2] JYMSJCPQ Add command to add all untracked files and fix repository refreshing
  • [3] H3GAPFUC Add pijul.recordAll command
  • [4] LUFSQKUV Enable support for experimental decorators
  • [5] ILH3GIVT Add command centre and refresh/init commands
  • [6] B4SKYP3Y Add repository model and add steps to initialize it
  • [7] YUVLBWV3 Populate resource groups for unrecorded and untracked changes
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] NCBEWRYE Initialize Repository

Change contents

  • replacement in src/repository.ts at line 1
    [3.16][3.17:122]()
    import { Disposable, OutputChannel, scm, SourceControl, SourceControlResourceGroup, Uri } from 'vscode';
    [3.16]
    [3.122]
    import { Disposable, OutputChannel, scm, SourceControl, SourceControlResourceGroup, Uri, window } from 'vscode';
  • replacement in src/repository.ts at line 19
    [3.787][3.787:910]()
    this.sourceControl.acceptInputCommand = { command: 'pijul.record', title: 'record', arguments: [this.sourceControl] };
    [3.787]
    [3.910]
    this.sourceControl.acceptInputCommand = { command: 'pijul.recordAll', title: 'record', arguments: [this.sourceControl] };
  • replacement in src/repository.ts at line 24
    [3.1029][3.1029:1068]()
    // TODO: Set input box placeholder
    [3.1029]
    [3.0]
    // Set the input box placeholder to match the hotkey
    if (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
    [3.155][3.155:268]()
    async recordAllChanges (message: string): Promise<void> {
    await this.repository.recordAllChanges(message);
    [3.155]
    [3.650]
    async recordAllChanges (message? : string): Promise<void> {
    if (!message) {
    message = this.sourceControl.inputBox.value;
    // Clear message
    this.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
    [2.268]
    [2.268]
    }
    /**
    * 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
    [3.3036]
    [9.4617]
    /**
    * 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
    [3.898][3.898:1295]()
    // TODO: Get message from input box
    const 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');
    }
    [3.898]
    [2.627]
    await repository.recordAllChanges();
  • edit in src/commands.ts at line 143
    [2.975]
    [2.975]
    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"