Add command to rename channels

[?]
Jan 5, 2021, 2:39 AM
64J6B76FTOAIPF2HGPIQYU523COLWHN7QOVC3XY42PHKC3GCLMZAC

Dependencies

  • [2] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [3] WHQQV5QQ Add watcher to refresh on file system changes
  • [4] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme
  • [5] B4SKYP3Y Add repository model and add steps to initialize it
  • [6] ILH3GIVT Add command centre and refresh/init commands
  • [7] BIEL6Z5J Update resource groups to use custom interface
  • [8] 6H4B4UJQ Add commands to open repo and global pijul configuration files
  • [9] L44OILGK Add reset command to resource state context menu
  • [10] 6ONRFFRG First pass of file decorations
  • [11] MU6ZNUYZ Integrate recordAll command with input box
  • [*] ZGMIJNFV Create pijul.ts for executing commands using the Pijul CLI
  • [*] L3VOQYAF Add changelog view to the source control panel
  • [*] NCBEWRYE Initialize Repository

Change contents

  • replacement in src/repository.ts at line 3
    [3.134][3.122:178](),[3.57][3.122:178](),[3.148][3.122:178](),[3.113][3.122:178](),[3.122][3.122:178]()
    import { Repository as BaseRepository } from './pijul';
    [3.57]
    [3.135]
    import { PijulChannel, Repository as BaseRepository } from './pijul';
  • edit in src/repository.ts at line 262
    [3.478]
    [3.1523]
    * Rename a channel. If a new name is not provided, the user will be prompted for one
    * @param channel The channel to rename
    * @param newName The new name that will be given to the channel
    */
    async renameChannel (channel: PijulChannel, newName?: string): Promise<void> {
    if (!newName) {
    newName = await window.showInputBox({
    placeHolder: 'Channel Name',
    prompt: 'Please enter the new name for channel ' + channel.name,
    ignoreFocusOut: true
    });
    }
    if (newName) {
    this.repository.renameChannel(channel, newName);
    } else {
    window.showErrorMessage('Channel was not renamed, no new name was provided');
    }
    }
    /**
  • edit in src/pijul.ts at line 319
    [14.1463]
    [14.1463]
    * Rename a channel in the repository.
    * @param channel The channel to rename
    * @param newName The new name that will be given to the channel
    */
    async renameChannel (channel: PijulChannel, newName: string): Promise<void> {
    await this._pijul.exec(this.repositoryRoot, ['channel', 'rename', channel.name, newName]);
    }
    /**
  • replacement in src/commands.ts at line 4
    [2.119][3.1275:1321](),[3.240][3.1275:1321]()
    import { Pijul, PijulChange } from './pijul';
    [2.119]
    [3.129]
    import { Pijul, PijulChange, PijulChannel } from './pijul';
  • edit in src/commands.ts at line 266
    [2.678]
    [2.678]
    }
    /**
    * Rename a channel
    * @param repository The repository that contains the channel
    */
    @command('pijul.renameChannel', { repository: true })
    async renameChannel (repository: Repository, channel: PijulChannel): Promise<void> {
    await repository.renameChannel(channel);
    await repository.refreshStatus();
  • edit in package.json at line 107
    [3.1793]
    [3.1175]
    "command": "pijul.renameChannel",
    "title": "Rename Channel",
    "category": "Pijul"
    },
    {
  • edit in package.json at line 283
    [2.1310]
    [3.1936]
    },
    {
    "command": "pijul.renameChannel",
    "when": "view == pijul.views.channels && viewItem == pijulChannel"