Add command to amend changes

[?]
Dec 31, 2020, 1:00 AM
TMXDVYNLUGUPQLK3CDSJB5TN4QQS5C4DLFV4TDT4HZG3FBUCNJYAC

Dependencies

  • [2] B3TBPH7R Add showOuput command to scm/title
  • [3] H3GAPFUC Add pijul.recordAll command
  • [4] BIEL6Z5J Update resource groups to use custom interface
  • [5] YUVLBWV3 Populate resource groups for unrecorded and untracked changes
  • [6] JYMSJCPQ Add command to add all untracked files and fix repository refreshing
  • [7] YDCLFNEJ Add menu command for recording changes to specific files
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] MU6ZNUYZ Integrate recordAll command with input box
  • [*] VWRDBPJZ Add command and menu option for adding one or more files to the repository
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] ILH3GIVT Add command centre and refresh/init commands
  • [*] NCBEWRYE Initialize Repository

Change contents

  • replacement in src/repository.ts at line 143
    [3.148][3.148:215]()
    private async getChangeMessage (): Promise<string | undefined> {
    [3.148]
    [3.215]
    private async getChangeMessage (options: IGetChangeMessageOptions = {}): Promise<string | undefined> {
  • replacement in src/repository.ts at line 148
    [3.354][3.354:374]()
    if (!message) {
    [3.354]
    [3.374]
    if (!message && !options.amend) {
  • edit in src/repository.ts at line 193
    [10.1167]
    [11.0]
    }
    }
    /**
    * Record all diffs from the pristine, amending the most recent change instead of creating a new one
    * @param message The message for the amended change
    */
    async amendAllChanges (message? : string): Promise<void> {
    if (!message) {
    message = await this.getChangeMessage({ amend: true });
  • edit in src/repository.ts at line 204
    [11.6]
    [11.6]
    // Get the message first, so that the user has the option of amending only the message
    if (this.changedGroup.resourceStates.length === 0 && !message) {
    window.showInformationMessage('No Changes to Record');
    return;
    }
    await this.repository.amendAllChanges(message);
  • edit in src/repository.ts at line 261
    [9.1665]
    /**
    * Options for the getChangeMessage method
    */
    interface IGetChangeMessageOptions {
    amend?: boolean
    }
  • replacement in src/pijul.ts at line 274
    [3.336][3.336:387]()
    * @param message The message for the new change
    [3.336]
    [3.387]
    * @param message The message for the amended change
  • edit in src/pijul.ts at line 278
    [3.535]
    [3.280]
    }
    /**
    * Record all diffs from the pristine, amending the most recent change instead of creating a new one
    * @param message An updated message for the change
    */
    async amendAllChanges (message?: string): Promise<void> {
    if (message) {
    await this._pijul.exec(this.repositoryRoot, ['record', '-a', '--amend', '-m', message]);
    } else {
    await this._pijul.exec(this.repositoryRoot, ['record', '-a', '--amend']);
    }
  • edit in src/commands.ts at line 157
    [10.1557]
    [3.627]
    await repository.refreshStatus();
    }
    /**
    * Amend the most recent change will all of the unrecorded changes
    * @param repository The repository to record in
    */
    @command('pijul.amendAll', { repository: true })
    async amendAll (repository: Repository): Promise<void> {
    await repository.amendAllChanges();
  • edit in package.json at line 51
    [3.1025]
    [11.926]
    "command": "pijul.amendAll",
    "title": "Record All Current Changes (Amend)",
    "category": "Pijul"
    },
    {
  • edit in package.json at line 140
    [11.1083]
    [2.0]
    "when": "scmProvider == pijul",
    "group": "second"
    },
    {
    "command": "pijul.amendAll",
  • edit in package.json at line 180
    [11.1450]
    [11.1450]
    "command": "pijul.amendAll",
    "when": "scmProvider == pijul && scmResourceGroup == changed"
    },
    {