Add commands for unrecording changes
[?]
Jan 7, 2021, 1:55 AM
GPTHUH3N7W2DMGEYDBKIAQFJS3CLNQEV667FQCRIH4ZNHFRODRLQCDependencies
- [2]
VT237HUJAdd tree view for channels - [3]
64J6B76FAdd command to rename channels - [4]
B4SKYP3YAdd repository model and add steps to initialize it - [5]
L44OILGKAdd reset command to resource state context menu - [6]
BIEL6Z5JUpdate resource groups to use custom interface - [7]
5ISTB4TWAdd commands to copy the hash and message of changes in the log - [8]
6ONRFFRGFirst pass of file decorations - [9]
GNQD74OZAdd pijul.openChange command and text document provider for pijul-change scheme - [*]
YDCLFNEJAdd menu command for recording changes to specific files - [*]
H3GAPFUCAdd pijul.recordAll command - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI - [*]
ILH3GIVTAdd command centre and refresh/init commands - [*]
NCBEWRYEInitialize Repository
Change contents
- replacement in src/repository.ts at line 3
import { PijulChannel, Repository as BaseRepository } from './pijul';import { IUnrecordOptions, PijulChange, PijulChannel, Repository as BaseRepository } from './pijul'; - edit in src/repository.ts at line 180
}/*** 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 messageawait this.repository.unrecordChange(change, options); - edit in src/pijul.ts at line 306
}/*** 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 flagconst 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
}/*** 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
"category": "Pijul"},{"command": "pijul.unrecordChange","title": "Unrecord Change","category": "Pijul"},{"command": "pijul.unrecordChangeReset","title": "Unrecord Change (Reset)", - replacement in package.json at line 310
"when": "view == pijul.views.log && viewItem == pijulChange""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
"group": "change""group": "changeThird" - replacement in package.json at line 331
"group": "change""group": "changeThird"