add Delete Remote command

Freax13
Aug 5, 2021, 11:29 AM
XVYOJLZ4GYPFZFVBTTR7U3HXG5KBDBD5VQAW64GA6V32O2VP2H4AC

Dependencies

  • [2] GPTHUH3N Add commands for unrecording changes
  • [3] HVVRC2GN Add command to apply all outstanding changes from one channel to another
  • [4] BIEL6Z5J Update resource groups to use custom interface
  • [5] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [6] 6H4B4UJQ Add commands to open repo and global pijul configuration files
  • [7] 64J6B76F Add command to rename channels
  • [8] 6ONRFFRG First pass of file decorations
  • [9] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme
  • [10] MO3G3S2V Cleanup commands available in the command palette
  • [11] L44OILGK Add reset command to resource state context menu
  • [12] ILH3GIVT Add command centre and refresh/init commands
  • [13] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] NCBEWRYE Initialize Repository
  • [*] 5ZDRHVXD Add command to fork a new channel

Change contents

  • replacement in src/repository.ts at line 3
    [4.57][2.0:101]()
    import { IUnrecordOptions, PijulChange, PijulChannel, Repository as BaseRepository } from './pijul';
    [4.57]
    [4.135]
    import { IUnrecordOptions, PijulChange, PijulChannel, PijulRemote, Repository as BaseRepository } from './pijul';
  • edit in src/repository.ts at line 361
    [3.427]
    [3.427]
    }
    }
    /**
    * Delete a remote
    * @param targetRemote The remote that will be deleted
    */
    async deleteRemote (targetRemote?: PijulRemote): Promise<void> {
    if (!targetRemote) {
    const items = (await this.repository.getRemotes()).map(c => ({
    label: c.url,
    description: c.remoteid,
    value: c
    }));
    const pick = await window.showQuickPick(items, { placeHolder: 'Remote url', ignoreFocusOut: true });
    targetRemote = pick?.value;
  • edit in src/repository.ts at line 378
    [3.433]
    [3.433]
    if (targetRemote) {
    await this.repository.deleteRemote(targetRemote);
    }
  • edit in src/pijul.ts at line 526
    [4.767]
    [15.4617]
    /**
    * Delete a remote of this repository with `pijul remote delete`
    */
    async deleteRemote (targetRemote: PijulRemote): Promise<void> {
    await this.pijul.exec(this.repositoryRoot, ['remote', 'delete', targetRemote.remoteid]);
    }
  • replacement in src/commands.ts at line 4
    [4.119][4.1107:1167]()
    import { Pijul, PijulChange, PijulChannel } from './pijul';
    [4.119]
    [4.129]
    import { Pijul, PijulChange, PijulChannel, PijulRemote } from './pijul';
  • edit in src/commands.ts at line 369
    [3.911]
    [4.258]
    * Delete a remote
    * @param repository The repository that contains the remote
    * @param targetRemote The remote to be deleted
    */
    @command('pijul.deleteRemote', { repository: true })
    async deleteRemote (repository: Repository, targetRemote?: PijulRemote): Promise<void> {
    await repository.deleteRemote(targetRemote);
    await repository.refreshStatus();
    }
    /**
  • edit in package.json at line 153
    [3.1085]
    [17.1258]
    },
    {
    "command": "pijul.deleteRemote",
    "title": "Delete Remote",
    "category": "Pijul",
    "icon": "$(remove)"
  • edit in package.json at line 488
    [3.1356]
    [4.1936]
    },
    {
    "command": "pijul.deleteRemote",
    "when": "view == pijul.views.remotes && viewItem == pijulRemote",
    "group": "inline"