diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs --- a/rust/hg-core/src/copy_tracing.rs +++ b/rust/hg-core/src/copy_tracing.rs @@ -16,7 +16,7 @@ type PathToken = usize; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug)] struct CopySource { /// revision at which the copy information was added rev: Revision, @@ -93,6 +93,21 @@ } } +// For the same "dest", content generated for a given revision will always be +// the same. +impl PartialEq for CopySource { + fn eq(&self, other: &Self) -> bool { + #[cfg(debug_assertions)] + { + if self.rev == other.rev { + debug_assert!(self.path == other.path); + debug_assert!(self.overwritten == other.overwritten); + } + } + self.rev == other.rev + } +} + /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation) type InternalPathCopies = OrdMap;