add comparing push operations

Freax13
Aug 5, 2021, 6:56 PM
PT4BQ3EA66QQOSTYW3WQRIOMYXEBZPDUPYEF25KVG7ITGRV5CBTQC

Dependencies

  • [2] OKOH6H2F add push and pull commands
  • [3] L44OILGK Add reset command to resource state context menu
  • [4] H3GAPFUC Add pijul.recordAll command
  • [5] 5ISTB4TW Add commands to copy the hash and message of changes in the log
  • [6] XVYOJLZ4 add Delete Remote command
  • [7] GPTHUH3N Add commands for unrecording changes
  • [8] 7DXA53YQ Add command to delete channel
  • [9] MGRAFWDZ Add commands for applying changes to channels
  • [10] HVVRC2GN Add command to apply all outstanding changes from one channel to another
  • [11] GNQD74OZ Add pijul.openChange command and text document provider for pijul-change scheme
  • [12] 5ZDRHVXD Add command to fork a new channel
  • [13] 64J6B76F Add command to rename channels
  • [14] LL5PNIAB Add command for switching to a given channel
  • [*] B4SKYP3Y Add repository model and add steps to initialize it
  • [*] ILH3GIVT Add command centre and refresh/init commands
  • [*] NCBEWRYE Initialize Repository

Change contents

  • replacement in src/repository.ts at line 197
    [2.11][2.11:51]()
    * Prompt the user to choose a remote
    [2.11]
    [2.51]
    * Prompt the user to choose a channel
  • replacement in src/repository.ts at line 199
    [2.57][2.57:141]()
    private async chooseChannel (placeHolder?: string): Promise<string | undefined> {
    [2.57]
    [2.141]
    private async chooseChannel (placeHolder: string): Promise<string | undefined> {
  • replacement in src/repository.ts at line 202
    [2.279][2.279:395]()
    return await window.showQuickPick(items, { placeHolder: placeHolder ?? 'Channel Name', ignoreFocusOut: true });
    [2.279]
    [3.31]
    return await window.showQuickPick(items, {
    placeHolder: placeHolder,
    ignoreFocusOut: true
    });
    }
    /**
    * Prompt the user to choose a channel name
    */
    private async chooseChannelName (prompt: string, placeHolder: string): Promise<string | undefined> {
    // TODO: Show more channel information with QuickPickOption
    return await window.showInputBox({
    placeHolder: placeHolder,
    prompt,
    ignoreFocusOut: true,
    validateInput: name => {
    if (name.includes(':')) {
    return 'Channel name may not contain a colon';
    } else {
    return undefined;
    }
    }
    });
  • replacement in src/repository.ts at line 234
    [3.280][3.280:346](),[3.346][2.396:444]()
    // TODO: Show more channel information with QuickPickOption
    channelName = await this.chooseChannel();
    [3.280]
    [3.505]
    channelName = await this.chooseChannel('Channel Name');
  • replacement in src/repository.ts at line 333
    [3.375][3.375:568]()
    newName = await window.showInputBox({
    placeHolder: 'Channel Name',
    prompt: 'Please enter the new name for channel ' + channel.name,
    ignoreFocusOut: true
    });
    [3.375]
    [3.568]
    newName = await this.chooseChannelName('Please enter the new name for channel ' + channel.name, 'Channel Name');
  • replacement in src/repository.ts at line 365
    [3.198][3.198:381]()
    channelName = await window.showInputBox({
    placeHolder: 'Channel Name',
    prompt: 'Please enter a name for the new Channel',
    ignoreFocusOut: true
    });
    [3.198]
    [3.381]
    channelName = await this.chooseChannelName('Please enter a name for the new Channel', 'Channel Name');
  • edit in src/repository.ts at line 406
    [2.1128]
    [2.1128]
    if (!targetRemote) { return; }
  • replacement in src/repository.ts at line 420
    [2.1408][2.1408:1490](),[2.1490][3.115:121](),[3.427][3.115:121]()
    if (targetRemote) {
    await this.repository.pull(targetRemote, from, to);
    }
    [2.1408]
    [3.121]
    await this.repository.pull(targetRemote, from, to);
  • edit in src/repository.ts at line 430
    [2.1757]
    [2.1757]
    if (!targetRemote) { return; }
  • edit in src/repository.ts at line 442
    [2.2030]
    [2.2030]
    }
    await this.repository.push(targetRemote, from, to);
    }
    /**
    * Push changes to a remote comparing to a channel
    * @param targetRemote The remote that will be pushed to
    */
    async compareToAndPushTo (targetRemote?: PijulRemote): Promise<void> {
    if (!targetRemote) {
    targetRemote = await this.chooseRemote();
    if (!targetRemote) { return; }
  • replacement in src/repository.ts at line 457
    [2.2037][2.2037:2119]()
    if (targetRemote) {
    await this.repository.push(targetRemote, from, to);
    [2.2037]
    [2.2119]
    const comparison = await this.chooseChannel('Comparison Channel');
    if (comparison === undefined) { return; }
    const to = await this.chooseChannelName('Please enter the name of the channel to push to', 'To Channel');
    if (to === undefined) { return; }
    await this.repository.push(targetRemote, undefined, comparison + ':' + to);
    }
    /**
    * Push changes to a remote comparing to a channel
    * @param targetRemote The remote that will be pushed to
    */
    async compareToCurrentAndPushTo (targetRemote?: PijulRemote): Promise<void> {
    if (!targetRemote) {
    targetRemote = await this.chooseRemote();
    if (!targetRemote) { return; }
    }
    const to = await this.chooseChannelName('Please enter the name of the channel to push to', 'To Channel');
    if (to === undefined) { return; }
    await this.repository.push(targetRemote, undefined, ':' + to);
    }
    /**
    * Push changes to a remote comparing to a channel
    * @param targetRemote The remote that will be pushed to
    */
    async compareToAndPushFromTo (targetRemote?: PijulRemote): Promise<void> {
    if (!targetRemote) {
    targetRemote = await this.chooseRemote();
    if (!targetRemote) { return; }
    }
    const comparison = await this.chooseChannel('Comparison Channel');
    if (comparison === undefined) { return; }
    const from = await this.chooseChannel('From Channel');
    if (from === undefined) { return; }
    const to = await this.chooseChannelName('Please enter the name of the channel to push to', 'To Channel');
    if (to === undefined) { return; }
    await this.repository.push(targetRemote, from, comparison + ':' + to);
    }
    /**
    * Push changes to a remote comparing to a channel
    * @param targetRemote The remote that will be pushed to
    */
    async compareToAndPushFromTo2 (targetRemote?: PijulRemote): Promise<void> {
    if (!targetRemote) {
    targetRemote = await this.chooseRemote();
    if (!targetRemote) { return; }
  • edit in src/repository.ts at line 513
    [2.2125]
    [2.2125]
    const from = await this.chooseChannel('From Channel');
    if (from === undefined) { return; }
    const to = await this.chooseChannelName('Please enter the name of the channel to push to', 'To Channel');
    if (to === undefined) { return; }
    await this.repository.push(targetRemote, from, ':' + to);
  • edit in src/commands.ts at line 446
    [2.6300]
    [3.900]
    }
    /**
    * Push changes
    * @param repository The repository that contains the remote
    * @param targetRemote The remote to be pushed to
    */
    @command('pijul.compareToAndPushTo', { repository: true })
    async compareToAndPushTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {
    await repository.compareToAndPushTo(targetRemote);
    }
    /**
    * Push changes from a channel
    * @param repository The repository that contains the remote
    * @param targetRemote The remote to be pushed to
    */
    @command('pijul.compareToCurrentAndPushTo', { repository: true })
    async compareToCurrentAndPushTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {
    await repository.compareToCurrentAndPushTo(targetRemote);
    }
    /**
    * Push changes to a channel
    * @param repository The repository that contains the remote
    * @param targetRemote The remote to be pushed to
    */
    @command('pijul.compareToAndPushFromTo', { repository: true })
    async compareToAndPushFromTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {
    await repository.compareToAndPushFromTo(targetRemote);
    }
    /**
    * Push changes from a channel to another channel
    * @param repository The repository that contains the remote
    * @param targetRemote The remote to be pushed to
    */
    @command('pijul.compareToAndPushFromTo2', { repository: true })
    async compareToAndPushFromTo2 (repository: Repository, targetRemote?: PijulRemote): Promise<void> {
    await repository.compareToAndPushFromTo2(targetRemote);
  • edit in package.json at line 209
    [2.7231]
    [2.7231]
    "category": "Pijul",
    "icon": "$(repo-push)"
    },
    {
    "command": "pijul.compareToAndPushTo",
    "title": "Compare to ... and push to ...",
    "category": "Pijul",
    "icon": "$(repo-push)"
    },
    {
    "command": "pijul.compareToCurrentAndPushTo",
    "title": "Compare to current and push to ...",
    "category": "Pijul",
    "icon": "$(repo-push)"
    },
    {
    "command": "pijul.compareToAndPushFromTo",
    "title": "Compare to ... and push from ... to ...",
  • edit in package.json at line 231
    [2.7294]
    [3.1404]
    "command": "pijul.compareToAndPushFromTo2",
    "title": "Compare to and push from ... to ...",
    "category": "Pijul",
    "icon": "$(repo-push)"
    },
    {
  • replacement in package.json at line 638
    [2.8467][2.8467:8497]()
    "command": "pijul.pull",
    [2.8467]
    [2.8497]
    "command": "pijul.compareToAndPushTo",
  • replacement in package.json at line 643
    [2.8611][2.8611:8645]()
    "command": "pijul.pullFrom",
    [2.8611]
    [2.8645]
    "command": "pijul.compareToCurrentAndPushTo",
  • replacement in package.json at line 648
    [2.8759][2.8759:8791]()
    "command": "pijul.pullTo",
    [2.8759]
    [2.8791]
    "command": "pijul.compareToAndPushFromTo",
  • replacement in package.json at line 653
    [2.8905][2.8905:8941]()
    "command": "pijul.pullFromTo",
    [2.8905]
    [2.8941]
    "command": "pijul.compareToAndPushFromTo2",
  • edit in package.json at line 656
    [2.9042]
    [2.9042]
    },
    {
    "command": "pijul.pull",
    "when": "view == pijul.views.remotes && viewItem == pijulRemote",
    "group": "changeFirst@9"
    },
    {
    "command": "pijul.pullFrom",
    "when": "view == pijul.views.remotes && viewItem == pijulRemote",
    "group": "changeFirst@10"
    },
    {
    "command": "pijul.pullTo",
    "when": "view == pijul.views.remotes && viewItem == pijulRemote",
    "group": "changeFirst@11"
    },
    {
    "command": "pijul.pullFromTo",
    "when": "view == pijul.views.remotes && viewItem == pijulRemote",
    "group": "changeFirst@12"