Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions client/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ fn parse_revision(_py: Python, rev: &Bound<PyAny>) -> PyResult<subversion::Revis
))),
}
} else if let Ok(n) = rev.extract::<i64>() {
let revnum = subvertpy_util::to_revnum(n).ok_or_else(|| {
PyErr::new::<pyo3::exceptions::PyValueError, _>("Invalid revision number")
})?;
let revnum = subvertpy_util::to_revnum_or_head(n);
Ok(subversion::Revision::Number(revnum))
} else {
Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
Expand Down Expand Up @@ -814,12 +812,7 @@ impl Client {
};

let base_rev = if let Some(rev) = base_revision_for_url {
subvertpy_util::to_revnum(rev).ok_or_else(|| {
PyErr::new::<pyo3::exceptions::PyValueError, _>(format!(
"Invalid revision number: {}",
rev
))
})?
subvertpy_util::to_revnum_or_head(rev)
} else {
subversion::Revnum::invalid()
};
Expand Down
6 changes: 2 additions & 4 deletions ra/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ impl Reporter {
PyErr::new::<pyo3::exceptions::PyRuntimeError, _>("Reporter has been consumed")
})?;

let rev = subvertpy_util::to_revnum(revision)
.ok_or_else(|| PyErr::new::<pyo3::exceptions::PyValueError, _>("Invalid revision"))?;
let rev = subvertpy_util::to_revnum_or_head(revision);

let svn_depth = match depth {
Some(d) => py_depth_to_svn(d)?,
Expand Down Expand Up @@ -125,8 +124,7 @@ impl Reporter {
PyErr::new::<pyo3::exceptions::PyRuntimeError, _>("Reporter has been consumed")
})?;

let rev = subvertpy_util::to_revnum(revision)
.ok_or_else(|| PyErr::new::<pyo3::exceptions::PyValueError, _>("Invalid revision"))?;
let rev = subvertpy_util::to_revnum_or_head(revision);

let svn_depth = match depth {
Some(d) => py_depth_to_svn(d)?,
Expand Down
Loading
Loading