Add command to apply all outstanding changes from one channel to another

[?]
Jan 12, 2021, 1:53 AM
HVVRC2GNC3D5PULNDL5XSPOQVJS2QWVU7GDGYSWLNYTK73UPYMHQC

Dependencies

  • [2] 5ZDRHVXD Add command to fork a new channel
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] 64J6B76F Add command to rename channels
  • [*] ILH3GIVT Add command centre and refresh/init commands
  • [*] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [*] 6H4B4UJQ Add commands to open repo and global pijul configuration files
  • [*] NCBEWRYE Initialize Repository
  • [*] 7DXA53YQ Add command to delete channel
  • [*] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme

Change contents

  • edit in src/repository.ts at line 352
    [5.763]
    [4.1523]
    * Apply all the oustanding changes from another channel to the current one
    * @param targetChannel The channel from which changes will be applied
    */
    async mergeChannel (targetChannel: PijulChannel): Promise<void> {
    const outstandingChanges = await this.repository.compareChannelChanges(targetChannel.name);
    for await (const change of outstandingChanges.reverse()) {
    this.repository.applyChange(change);
    }
    }
    /**
  • edit in src/commands.ts at line 358
    [7.689]
    [8.258]
    * Apply all the oustanding changes from another channel to the current one
    * @param repository The repository that contains the channel
    * @param targetChannel The channel to be merged into the current one
    */
    @command('pijul.mergeChannel', { repository: true })
    async mergeChannel (repository: Repository, targetChannel: PijulChannel): Promise<void> {
    await repository.mergeChannel(targetChannel);
    await repository.refreshStatus();
    }
    /**
  • edit in package.json at line 146
    [2.1258]
    [2.1258]
    },
    {
    "command": "pijul.mergeChannel",
    "title": "Apply All Outstanding Changes to Current Channel (Merge)",
    "category": "Pijul",
    "icon": "$(git-merge)"
  • edit in package.json at line 472
    [10.1133]
    [11.1936]
    },
    {
    "command": "pijul.mergeChannel",
    "when": "view == pijul.views.channels && viewItem == pijulChannel"
    },
    {
    "command": "pijul.mergeChannel",
    "when": "view == pijul.views.channels && viewItem == pijulChannel",
    "group": "inline"