diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs index e28cb3a8eb75d638e02e93926a5e11094051ec68_cnVzdC9oZy1jb3JlL3NyYy9jb3B5X3RyYWNpbmcucnM=..441c84eba30ff0edc4082ab25a67490b6dd78a4a_cnVzdC9oZy1jb3JlL3NyYy9jb3B5X3RyYWNpbmcucnM= 100644 --- 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, @@ -91,6 +91,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<PathToken, CopySource>;