add push and pull commands
Dependencies
- [2]
MGRAFWDZAdd commands for applying changes to channels - [3]
YTQW3VKIRun yarn lint --fix - [4]
YPGOGP7Zadd copy remote url and id commands - [5]
H3GAPFUCAdd pijul.recordAll command - [6]
HVVRC2GNAdd command to apply all outstanding changes from one channel to another - [7]
XVYOJLZ4add Delete Remote command - [*]
B4SKYP3YAdd repository model and add steps to initialize it - [*]
GPTHUH3NAdd commands for unrecording changes - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI - [*]
L44OILGKAdd reset command to resource state context menu - [*]
ILH3GIVTAdd command centre and refresh/init commands - [*]
NCBEWRYEInitialize Repository - [*]
GNQD74OZAdd pijul.openChange command and text document provider for pijul-change scheme - [*]
5ISTB4TWAdd commands to copy the hash and message of changes in the log - [*]
L3VOQYAFAdd changelog view to the source control panel
Change contents
- edit in src/repository.ts at line 194
}/*** Prompt the user to choose a remote*/private async chooseChannel (placeHolder?: string): Promise<string | undefined> {// TODO: Show more channel information with QuickPickOptionconst items = (await this.repository.getChannels()).map(c => c.name);return await window.showQuickPick(items, { placeHolder: placeHolder ?? 'Channel Name', ignoreFocusOut: true }); - replacement in src/repository.ts at line 213
channelName = await window.showQuickPick((await this.repository.getChannels()).map(c => c.name), { placeHolder: 'Channel Name', ignoreFocusOut: true });channelName = await this.chooseChannel(); - edit in src/repository.ts at line 370
}}/*** Prompt the user to choose a remote*/private async chooseRemote (): Promise<PijulRemote | undefined> {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 });return pick?.value;}/*** Pull changes from a remote* @param targetRemote The remote that will be pulled from*/async pull (options: {from: boolean, to: boolean}, targetRemote?: PijulRemote): Promise<void> {if (!targetRemote) {targetRemote = await this.chooseRemote();}let from;if (options.from) {from = await this.chooseChannel('From Channel');if (from === undefined) { return; }}let to;if (options.to) {to = await this.chooseChannel('To Channel');if (to === undefined) { return; }}if (targetRemote) {await this.repository.pull(targetRemote, from, to); - edit in src/repository.ts at line 412
* Push changes to a remote* @param targetRemote The remote that will be pushed to*/async push (options: {from: boolean, to: boolean}, targetRemote?: PijulRemote): Promise<void> {if (!targetRemote) {targetRemote = await this.chooseRemote();}let from;if (options.from) {from = await this.chooseChannel('From Channel');if (from === undefined) { return; }}let to;if (options.to) {to = await this.chooseChannel('To Channel');if (to === undefined) { return; }}if (targetRemote) {await this.repository.push(targetRemote, from, to);}}/** - replacement in src/repository.ts at line 442
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;targetRemote = await this.chooseRemote(); - edit in src/repository.ts at line 444
if (!targetRemote) return; - replacement in src/repository.ts at line 446
if (targetRemote) {await this.repository.deleteRemote(targetRemote);}const pick = await window.showWarningMessage('Are you sure you want to delete ' + targetRemote.url + '?', { modal: true }, 'Yes');if (pick !== 'Yes') return;await this.repository.deleteRemote(targetRemote); - edit in src/pijul.ts at line 525
}/*** Pull from a remote of this repository with `pijul pull [url] -a`*/async pull (targetRemote: PijulRemote, from: string | undefined, to: string | undefined): Promise<void> {const args = ['pull', targetRemote.url, '-a'];if (from !== undefined) {args.push('--from-channel', from);}if (to !== undefined) {args.push('--to-channel', to);}await this.pijul.exec(this.repositoryRoot, args);}/*** Push to a remote of this repository with `pijul push [url] -a`*/async push (targetRemote: PijulRemote, from: string | undefined, to: string | undefined): Promise<void> {const args = ['push', targetRemote.url, '-a'];if (from !== undefined) {args.push('--from-channel', from);}if (to !== undefined) {args.push('--to-channel', to);}await this.pijul.exec(this.repositoryRoot, args); - edit in src/commands.ts at line 366
}/*** Pull changes* @param repository The repository that contains the remote* @param targetRemote The remote to be pulled from*/@command('pijul.pull', { repository: true })async pull (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.pull({ from: false, to: false }, targetRemote);}/*** Pull changes from a channel* @param repository The repository that contains the remote* @param targetRemote The remote to be pulled from*/@command('pijul.pullFrom', { repository: true })async pullFrom (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.pull({ from: true, to: false }, targetRemote);}/*** Pull changes to a channel* @param repository The repository that contains the remote* @param targetRemote The remote to be pulled from*/@command('pijul.pullTo', { repository: true })async pullTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.pull({ from: false, to: true }, targetRemote);}/*** Pull changes from a channel to another channel* @param repository The repository that contains the remote* @param targetRemote The remote to be pulled from*/@command('pijul.pullFromTo', { repository: true })async pullFromTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.pull({ from: true, to: true }, targetRemote);}/*** Push changes* @param repository The repository that contains the remote* @param targetRemote The remote to be pushed to*/@command('pijul.push', { repository: true })async push (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.push({ from: false, to: false }, targetRemote);}/*** Push changes from a channel* @param repository The repository that contains the remote* @param targetRemote The remote to be pushed to*/@command('pijul.pushFrom', { repository: true })async pushFrom (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.push({ from: true, to: false }, targetRemote);}/*** Push changes to a channel* @param repository The repository that contains the remote* @param targetRemote The remote to be pushed to*/@command('pijul.pushTo', { repository: true })async pushTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.push({ from: false, to: true }, 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.pushFromTo', { repository: true })async pushFromTo (repository: Repository, targetRemote?: PijulRemote): Promise<void> {await repository.push({ from: true, to: true }, targetRemote); - edit in package.json at line 163
},{"command": "pijul.pull","title": "Pull","category": "Pijul","icon": "$(repo-pull)"},{"command": "pijul.pullFrom","title": "Pull from ...","category": "Pijul","icon": "$(repo-pull)"},{"command": "pijul.pullTo","title": "Pull to ...","category": "Pijul","icon": "$(repo-pull)" - edit in package.json at line 183
"command": "pijul.pullFromTo","title": "Pull from ... to ...","category": "Pijul","icon": "$(repo-pull)"},{"command": "pijul.push","title": "Push","category": "Pijul","icon": "$(repo-push)"},{"command": "pijul.pushFrom","title": "Push from ...","category": "Pijul","icon": "$(repo-push)"},{"command": "pijul.pushTo","title": "Push to ...","category": "Pijul","icon": "$(repo-push)"},{"command": "pijul.pushFromTo","title": "Push from ... to ...","category": "Pijul","icon": "$(repo-push)"},{ - edit in package.json at line 554
},{"command": "pijul.push","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@1"},{"command": "pijul.pull","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@2"},{"submenu": "pijul.pushpull","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@3" - edit in package.json at line 572
"name": "Delete", - replacement in package.json at line 574
"group": "changeFirst""group": "changeSecond" - replacement in package.json at line 579
"group": "changeSecond""group": "changeThird" - replacement in package.json at line 584
"group": "changeSecond""group": "changeThird" - edit in package.json at line 591
],"pijul.pushpull": [{"command": "pijul.push","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@1"},{"command": "pijul.pushFrom","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@2"},{"command": "pijul.pushTo","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@3"},{"command": "pijul.pushFromTo","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@4"},{"command": "pijul.pull","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@5"},{"command": "pijul.pullFrom","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@6"},{"command": "pijul.pullTo","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@7"},{"command": "pijul.pullFromTo","when": "view == pijul.views.remotes && viewItem == pijulRemote","group": "changeFirst@8"} - edit in package.json at line 635[17.2698][17.2698]
"submenus": [{"id": "pijul.pushpull","label": "Push/Pull"}],