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

@ -108,6 +108,40 @@ def get_file_history():
except Exception as e:
return jsonify({"error": str(e)}), 500
@api_bp.route('/api/v1/patchsets', methods=['GET'])
def get_patchsets():
"""
Get repository patchset history using cvsps
"""
if not cvs_client:
return jsonify({"error": "CVS Client not initialized"}), 500
try:
patchsets = cvs_client.get_patchsets()
return jsonify(patchsets)
except Exception as e:
return jsonify({"error": str(e)}), 500
@api_bp.route('/api/v1/patchset-diff', methods=['GET'])
def get_patchset_diff():
"""
Get diff for a specific patchset
Required query param: patchset (patchset number)
"""
if not cvs_client:
return jsonify({"error": "CVS Client not initialized"}), 500
patchset = request.args.get('patchset')
if not patchset:
return jsonify({"error": "Missing patchset parameter"}), 400
try:
diff = cvs_client.get_patchset_diff(patchset)
return jsonify({"diff": diff})
except Exception as e:
return jsonify({"error": str(e)}), 500
@api_bp.route('/api/v1/file', methods=['GET'])
def get_file_content():
"""