Show altered files instead of dependencies as children of changes in changelog
[?]
Jan 14, 2021, 8:56 PM
7A3NMQ6QLJBGUXO4YWSBSDLP6MBZXBRCMMLO72R5HLCYOAYF7TYQCDependencies
- [2]
GGYUCHWQUpdate change tooltip in changelog - [3]
GVFKCLQHPrevent dependencies from appearing multiple times under the same change - [4]
5P6DJRJQFix outdated comment on changelog children - [5]
L3VOQYAFAdd changelog view to the source control panel - [6]
HF3NERPZAdd cache for changes and add change dependencies to log - [7]
J6DDODYYUpdate views to refresh with the rest of the repository state - [8]
WCQM6IOKAdd parsing of Author strings - [9]
GNQD74OZAdd pijul.openChange command and text document provider for pijul-change scheme - [*]
ZGMIJNFVCreate pijul.ts for executing commands using the Pijul CLI - [*]
H3GAPFUCAdd pijul.recordAll command
Change contents
- replacement in src/views/changelog.ts at line 8
export class ChangelogViewProvider implements TreeDataProvider<PijulChange> {export class ChangelogViewProvider implements TreeDataProvider<PijulChange | string> { - replacement in src/views/changelog.ts at line 22
getTreeItem (element: PijulChange): TreeItem | Thenable<TreeItem> {const resourceUri = Uri.parse('pijul-change:' + element.hash);getTreeItem (element: PijulChange | string): TreeItem | Thenable<TreeItem> {if (element instanceof PijulChange) {const resourceUri = Uri.parse('pijul-change:' + element.hash); - replacement in src/views/changelog.ts at line 26[5.153]→[5.666:679](∅→∅),[5.666]→[5.666:679](∅→∅),[5.679]→[5.0:27](∅→∅),[5.27]→[5.703:733](∅→∅),[5.703]→[5.703:733](∅→∅),[5.733]→[5.0:76](∅→∅),[5.76]→[5.28:88](∅→∅),[5.88]→[5.209:244](∅→∅),[5.209]→[5.209:244](∅→∅),[5.244]→[2.0:156](∅→∅),[2.156]→[5.276:401](∅→∅),[5.276]→[5.276:401](∅→∅),[5.401]→[5.820:827](∅→∅),[5.820]→[5.820:827](∅→∅)
return {// id: element.hash,label: element.message,description: `${element.author.name}, ${element.date.toISOString()}`,collapsibleState: TreeItemCollapsibleState.Collapsed,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: [resourceUri]}};return {label: element.message,description: `${element.author.name}, ${element.date.toISOString()}`,collapsibleState: TreeItemCollapsibleState.Collapsed,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: [resourceUri]}};} else {// It's a string, representing a file path// TODO: Use URIs instead of strings// TODO: Customize appearance depending on file action (Edit, Replacement, Deletion, etc.)const sections = element.split(/\\|\//);return {label: sections[sections.length - 1],description: sections.slice(0, -1).join('/'),collapsibleState: TreeItemCollapsibleState.None,contextValue: 'pijulChangedFile'// TODO: Command and Tooltip};} - replacement in src/views/changelog.ts at line 57
async getChildren (element?: PijulChange): Promise<PijulChange[] | null | undefined> {async getChildren (element?: PijulChange | string): Promise<Array<PijulChange | string> | null | undefined> { - replacement in src/views/changelog.ts at line 59
// Show changes which the current one depends onreturn await this.repository.getChangeDependencies(element);if (element instanceof PijulChange) {// Show the paths of the files altered by the parent changereturn await this.repository.getChangeFiles(element);} else {// Paths have no childrenreturn null;} - edit in src/pijul.ts at line 303[3.138][12.269]
}/*** Gets a list of the files which were altered in a change* @param change The change to retrieve the altered files for*/async getChangeFiles (change: PijulChange): Promise<string[]> {const changeToml = await this.getChangeToml(change.hash);const changePattern = /\d\.\s([A-Za-z]+)\sin\s(.*):/g;const files: Set<string> = new Set();let match = changePattern.exec(changeToml);while (match) {files.add(match[2]);match = changePattern.exec(changeToml);}return [...files];