Add commands for applying changes to channels

[?]
Jan 11, 2021, 1:36 AM
MGRAFWDZTJ6ODMSPYNX4YLJ5JLQGN535AVTX3F6GFS54IHMEZ2EQC

Dependencies

  • [2] LL5PNIAB Add command for switching to a given channel
  • [3] GPTHUH3N Add commands for unrecording changes
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] H3GAPFUC Add pijul.recordAll command
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] YDCLFNEJ Add menu command for recording changes to specific files
  • [*] ILH3GIVT Add command centre and refresh/init commands
  • [*] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [*] 64J6B76F Add command to rename channels
  • [*] NCBEWRYE Initialize Repository

Change contents

  • edit in src/repository.ts at line 193
    [6.42]
    [6.42]
    * Apply a change to a given channel
    * @param change The change to apply to a channel
    * @param channelName The name of the channel the change will be applied to
    */
    async applyChange (change: PijulChange, channelName?: string): Promise<void> {
    if (!channelName) {
    // TODO: Show more channel information with QuickPickOption
    channelName = await window.showQuickPick((await this.repository.getChannels()).map(c => c.name), { placeHolder: 'Channel Name', ignoreFocusOut: true });
    }
    this.repository.applyChange(change, channelName);
    }
    /**
    * Apply a change to the current channel
    * @param change The change to apply
    */
    async applyChangeToCurrentChannel (change: PijulChange): Promise<void> {
    this.repository.applyChange(change);
    }
    /**
  • edit in src/pijul.ts at line 320
    [8.1634]
    [6.280]
    * Apply a change to a given channel or the current channel if no channel name is provided
    * @param change The change to apply to a channel
    * @param channelName The name of the channel the change will be applied to
    */
    async applyChange (change: PijulChange, channelName?: string): Promise<void> {
    const additionalArgs: string[] = [];
    if (channelName) {
    additionalArgs.push('--channel', channelName);
    }
    await this._pijul.exec(this.repositoryRoot, ['apply', change.hash, ...additionalArgs]);
    }
    /**
  • edit in src/commands.ts at line 289
    [10.678]
    [11.1168]
    }
    /**
    * Apply a change to a channel
    * @param change The change to apply to a channel
    */
    @command('pijul.applyChange', { repository: true })
    async applyChange (repository: Repository, change: PijulChange): Promise<void> {
    repository.applyChange(change);
  • edit in src/commands.ts at line 301
    [11.1179]
    [11.1179]
    * Apply a change to the current channel
    * @param change The change to apply
    */
    @command('pijul.applyChangeToCurrentChannel', { repository: true })
    async applyChangeToCurrentChannel (repository: Repository, change: PijulChange): Promise<void> {
    repository.applyChangeToCurrentChannel(change);
    }
    /**
  • edit in package.json at line 99
    [3.2297]
    [3.2297]
    "category": "Pijul"
    },
    {
    "command": "pijul.applyChange",
    "title": "Apply Change to Channel...",
    "category": "Pijul"
    },
    {
    "command": "pijul.applyChangeToCurrentChannel",
    "title": "Apply Change to Current Channel",
  • edit in package.json at line 342
    [3.2873]
    [11.1603]
    },
    {
    "command": "pijul.applyChange",
    "when": "viewItem == pijulChange",
    "group": "changeFourth"
  • edit in package.json at line 349
    [11.1616]
    [2.1294]
    "command": "pijul.applyChangeToCurrentChannel",
    "when": "view == pijul.views.channels && viewItem == pijulChange",
    "group": "changeFourth"
    },
    {