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:
Juan José Gutiérrez de Quevedo Pérez 2025-11-21 17:18:55 +01:00
parent c263092c10
commit d3b40ae93f
9 changed files with 660 additions and 26 deletions

View file

@ -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);
});
}
}