Add commands for unrecording changes

[?]
Jan 7, 2021, 1:55 AM
GPTHUH3N7W2DMGEYDBKIAQFJS3CLNQEV667FQCRIH4ZNHFRODRLQC

Dependencies

  • [2] VT237HUJ Add tree view for channels
  • [3] 64J6B76F Add command to rename channels
  • [4] B4SKYP3Y Add repository model and add steps to initialize it
  • [5] L44OILGK Add reset command to resource state context menu
  • [6] BIEL6Z5J Update resource groups to use custom interface
  • [7] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [8] 6ONRFFRG First pass of file decorations
  • [9] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme
  • [*] YDCLFNEJ Add menu command for recording changes to specific files
  • [*] H3GAPFUC Add pijul.recordAll command
  • [*] 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 3
    [4.57][3.0:70]()
    import { PijulChannel, Repository as BaseRepository } from './pijul';
    [4.57]
    [4.135]
    import { IUnrecordOptions, PijulChange, PijulChannel, Repository as BaseRepository } from './pijul';
  • edit in src/repository.ts at line 180
    [11.1191]
    [12.31]
    }
    /**
    * Unrecord a change
    * @param change The change that will be unrecorded
    * @param options The options for unrecording a change, indicating if the changes should be reset
    */
    async unrecordChange (change: PijulChange, options: IUnrecordOptions = {}): Promise<void> {
    // TODO: Warning message
    await this.repository.unrecordChange(change, options);
  • edit in src/pijul.ts at line 306
    [11.1623]
    [11.1623]
    }
    /**
    * Unrecord a change
    * @param change The change that will be unrecorded
    * @param options The options for unrecording a change, indicating if the changes should be reset
    */
    async unrecordChange (change: PijulChange, options: IUnrecordOptions = {}): Promise<void> {
    // TODO: Consider working around issues with the reset flag
    const optionArray: string[] = options.reset ? ['--reset'] : [];
    await this._pijul.exec(this.repositoryRoot, ['unrecord', change.hash, ...optionArray]);
  • edit in src/pijul.ts at line 598
    [2.2507]
    /**
    * Options for unrecording a change
    */
    export interface IUnrecordOptions {
    reset?: boolean
    }
  • edit in src/commands.ts at line 247
    [4.1678]
    [4.1678]
    }
    /**
    * Unrecords a given change, without touching the working copy
    * @param change The change to uynrecord
    */
    @command('pijul.unrecordChange', { repository: true })
    async unrecordChange (repository: Repository, change: PijulChange): Promise<void> {
    if (await commandWarning(`Are you sure you want to unrecord change ${change.hash.substr(0, 10)}... ? The changes will remain in your working directory.`)) {
    await repository.unrecordChange(change);
    await repository.refreshStatus();
    }
    }
    /**
    * Unrecords a given change, resetting its changes from the working copy
    * @param change The change top unrecord
    */
    @command('pijul.unrecordChangeReset', { repository: true })
    async unrecordChangeReset (repository: Repository, change: PijulChange): Promise<void> {
    if (await commandWarning(`Are you sure you want to unrecord change ${change.hash.substr(0, 10)}... and reset your working directory? This may be a destructive action.`)) {
    await repository.unrecordChange(change, { reset: true });
    await repository.refreshStatus();
    }
  • edit in package.json at line 94
    [4.1758]
    [4.690]
    "category": "Pijul"
    },
    {
    "command": "pijul.unrecordChange",
    "title": "Unrecord Change",
    "category": "Pijul"
    },
    {
    "command": "pijul.unrecordChangeReset",
    "title": "Unrecord Change (Reset)",
  • replacement in package.json at line 310
    [4.955][4.955:1021]()
    "when": "view == pijul.views.log && viewItem == pijulChange"
    [4.955]
    [4.1021]
    "when": "view == pijul.views.log && viewItem == pijulChange",
    "group": "changeFirst"
    },
    {
    "command": "pijul.unrecordChange",
    "when": "view == pijul.views.log && viewItem == pijulChange",
    "group": "changeSecond"
    },
    {
    "command": "pijul.unrecordChangeReset",
    "when": "view == pijul.views.log && viewItem == pijulChange",
    "group": "changeSecond"
  • replacement in package.json at line 326
    [4.1141][4.1141:1164]()
    "group": "change"
    [4.1141]
    [4.1164]
    "group": "changeThird"
  • replacement in package.json at line 331
    [4.1287][4.1287:1310]()
    "group": "change"
    [4.1287]
    [3.1603]
    "group": "changeThird"