List channel changes under each channel in Channels view
[?]
Jan 11, 2021, 8:49 PM
USPPMDII5BK5SBT4DCD7TETL2YSPZ2CVXREPKNPGQUU3SKFONM4ACDependencies
- [2]
J6DDODYYUpdate views to refresh with the rest of the repository state - [3]
LL5PNIABAdd command for switching to a given channel - [4]
HF3NERPZAdd cache for changes and add change dependencies to log - [5]
FM2OUEL7Change log parsing regex for better handling of multi-line messages - [6]
GGYKE3DVEnforce documentation on every Function, Method, and Class - [7]
L3VOQYAFAdd changelog view to the source control panel - [8]
VT237HUJAdd tree view for channels - [9]
OXW4KMVUAdd QuickDiffProvider - [10]
64J6B76FAdd command to rename channels - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI
Change contents
- replacement in src/views/channels.ts at line 1
import { Event, TreeDataProvider, TreeItem, TreeItemCollapsibleState } from 'vscode';import { PijulChannel, Repository } from '../pijul';import { Event, TreeDataProvider, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode';import { PijulChange, PijulChannel, Repository } from '../pijul'; - replacement in src/views/channels.ts at line 8
export class ChannelsViewProvider implements TreeDataProvider<PijulChannel> {export class ChannelsViewProvider implements TreeDataProvider<PijulChannel | PijulChange> { - replacement in src/views/channels.ts at line 22
getTreeItem (element: PijulChannel): TreeItem | Thenable<TreeItem> {return {id: element.name,label: element.name,description: element.isCurrent ? 'Current' : undefined,collapsibleState: TreeItemCollapsibleState.None,// Different context menu options for current and inactive channelscontextValue: 'pijulChannel' + (element.isCurrent ? 'Current' : '')};getTreeItem (element: PijulChannel | PijulChange): TreeItem | Thenable<TreeItem> {if (element instanceof PijulChannel) {return {id: element.name,label: element.name,description: element.isCurrent ? 'Current' : undefined,collapsibleState: element.isCurrent ? TreeItemCollapsibleState.None : TreeItemCollapsibleState.Collapsed,// Different context menu options for current and inactive channelscontextValue: 'pijulChannel' + (element.isCurrent ? 'Current' : '')};} else {return {label: element.message,description: `${element.author.name}, ${element.date.toISOString()}`,collapsibleState: TreeItemCollapsibleState.None,contextValue: 'pijulChange',tooltip: `${element.hash}\nRecorded by ${element.author.fullName ?? element.author.name} at ${element.date.toISOString()}\n\n\t${element.message}\n`,command: {command: 'vscode.open',title: 'Open Change TOML',arguments: [Uri.parse('pijul-change:' + element.hash)]}};} - replacement in src/views/channels.ts at line 52
async getChildren (element?: PijulChannel): Promise<PijulChannel[] | null | undefined> {async getChildren (element?: PijulChannel | PijulChange): Promise<Array<PijulChannel | PijulChange> | null | undefined> { - replacement in src/views/channels.ts at line 55
// TODO: Show the changes in this channel as childrenreturn null;if (element instanceof PijulChannel) {return await this.repository.getLog(element.name);} else {return null;} - replacement in src/pijul.ts at line 149
* A dictionary for holding a cache of change hashes to avoid recalculating them each time* A dictionary for holding a cache of change hashes to avoid recalculating them each time.* Persists between refreshes. - edit in src/pijul.ts at line 154
// TODO: Create a number of sets which hold the state of the channels in memory.// Instead of each log, remote, or channel listing operation interacting with the CLI,// the state of the repository will be loaded each refresh and then accessed through the cache. - edit in src/pijul.ts at line 415
* @param channel optional name of a channel to get the log for - replacement in src/pijul.ts at line 417
async getLog (): Promise<PijulChange[]> {async getLog (channel?: string): Promise<PijulChange[]> { - edit in src/pijul.ts at line 419
const additionalArgs: string[] = [];if (channel) {additionalArgs.push('--channel', channel);} - replacement in src/pijul.ts at line 426
const result = await this._pijul.exec(this.repositoryRoot, ['log']);const result = await this._pijul.exec(this.repositoryRoot, ['log', ...additionalArgs]);