feat: Add patchset history and diff support with cvsps integration
- Add cvsps package to Docker dependencies - Implement patchset retrieval and diff endpoints in API - Add _run_cvsps_command() helper for cvsps integration - Enhance file history parsing with log message extraction - Improve UI with enhanced styling and patchset functionality
This commit is contained in:
parent
c263092c10
commit
d3b40ae93f
9 changed files with 660 additions and 26 deletions
43
ui/app.js
43
ui/app.js
|
|
@ -158,6 +158,38 @@ class CVSRepositoryBrowser {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show patchsets view
|
||||
*/
|
||||
async showPatchsets() {
|
||||
try {
|
||||
ui.patchsetContent.innerHTML = '<div class="loading">Loading patchsets...</div>';
|
||||
const patchsets = await api.getPatchsets();
|
||||
ui.displayPatchsets(patchsets);
|
||||
} catch (error) {
|
||||
console.error('Error showing patchsets:', error);
|
||||
ui.patchsetContent.innerHTML = `<div class="loading" style="color: #991b1b;">Error loading patchsets: ${error.message}</div>`;
|
||||
ui.showView(ui.patchsetView);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show patchset diff
|
||||
* @param {string} patchset - Patchset number
|
||||
*/
|
||||
async showPatchsetDiff(patchset) {
|
||||
try {
|
||||
ui.patchsetDiffContent.innerHTML = '<div class="loading">Loading patchset diff...</div>';
|
||||
const diffResult = await api.getPatchsetDiff(patchset);
|
||||
const diffText = diffResult.diff || diffResult;
|
||||
ui.displayPatchsetDiff(diffText);
|
||||
} catch (error) {
|
||||
console.error('Error showing patchset diff:', error);
|
||||
ui.patchsetDiffContent.innerHTML = `<div class="loading" style="color: #991b1b;">Error loading patchset diff: ${error.message}</div>`;
|
||||
ui.showView(ui.patchsetDiffView);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup event listeners
|
||||
*/
|
||||
|
|
@ -176,6 +208,17 @@ class CVSRepositoryBrowser {
|
|||
ui.backFromDiffBtn.addEventListener('click', () => {
|
||||
ui.showView(ui.fileView);
|
||||
});
|
||||
|
||||
// Patchset view buttons
|
||||
ui.patchsetsBtn.addEventListener('click', () => this.showPatchsets());
|
||||
ui.backFromPatchsetBtn.addEventListener('click', () => {
|
||||
ui.showView(ui.welcomeView);
|
||||
});
|
||||
|
||||
// Patchset diff view back button
|
||||
ui.backFromPatchsetDiffBtn.addEventListener('click', () => {
|
||||
ui.showView(ui.patchsetView);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue