File history timeline (filelog) with diff-to-previous

- File history button in the preview header opens a per-file revision timeline
  (rev, changelist, action, user, date, description) with Diff to previous
- Backend p4 filelog -l; filelogRevs parser

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-07-08 12:03:32 +03:00
parent 2069f0fed4
commit ecc5b8e9bf
5 changed files with 104 additions and 4 deletions

View File

@ -1867,6 +1867,19 @@ async fn p4_latest_change(state: State<'_, AppState>, scope: String) -> Result<V
Ok(v.into_iter().next().unwrap_or(Value::Null))
}
/// Full revision history of a single file (`p4 filelog -l`), including
/// per-revision changelist, action, user, time and description. Returns the
/// tagged object with rev0/change0/action0/… arrays.
#[tauri::command]
async fn p4_filelog(state: State<'_, AppState>, depot: String) -> Result<Value, String> {
let conn = current(&state)?;
if depot.trim().is_empty() {
return Err("No file".into());
}
let v = run_json(&conn, &["filelog", "-l", "-m", "150", depot.trim()])?;
Ok(v.into_iter().next().unwrap_or(Value::Null))
}
/// List jobs on the server (defect/task tracking).
#[tauri::command]
async fn p4_jobs(state: State<'_, AppState>) -> Result<Vec<Value>, String> {
@ -2209,6 +2222,7 @@ pub fn run() {
p4_streams,
p4_switch_stream,
p4_stream_integ,
p4_filelog,
p4_jobs,
p4_fix,
p4_job_spec,