Patchwork D9642: copies-rust: rename TimeStampedPathCopy to CopySource

login
register
mail settings
Submitter phabricator
Date Dec. 21, 2020, 10:28 p.m.
Message ID <differential-rev-PHID-DREV-gntfmjgrgqpcwqkrhdlq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47952/
State Superseded
Headers show

Comments

phabricator - Dec. 21, 2020, 10:28 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Same rational as the previous changesets. CopySource is a clear descriptive name
  that does not depends on an implementation details that we are about to the
  change.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9642

AFFECTED FILES
  rust/hg-core/src/copy_tracing.rs

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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, Copy)]
-struct TimeStampedPathCopy {
+struct CopySource {
     /// revision at which the copy information was added
     rev: Revision,
     /// the copy source, (Set to None in case of deletion of the associated
@@ -25,7 +25,7 @@ 
 }
 
 /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation)
-type InternalPathCopies = OrdMap<PathToken, TimeStampedPathCopy>;
+type InternalPathCopies = OrdMap<PathToken, CopySource>;
 
 /// hold parent 1, parent 2 and relevant files actions.
 pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>);
@@ -521,7 +521,7 @@ 
                 // information. See merge_copies_dict for details.
                 match copies.entry(dest) {
                     Entry::Vacant(slot) => {
-                        let ttpc = TimeStampedPathCopy {
+                        let ttpc = CopySource {
                             rev: current_rev,
                             path: entry,
                         };
@@ -570,8 +570,8 @@ 
     // code is more settled.
     let cmp_value = |oracle: &mut AncestorOracle<A>,
                      dest: &PathToken,
-                     src_minor: &TimeStampedPathCopy,
-                     src_major: &TimeStampedPathCopy| {
+                     src_minor: &CopySource,
+                     src_major: &CopySource| {
         compare_value(
             path_map,
             current_merge,
@@ -619,7 +619,7 @@ 
                             MergePick::Minor => src_minor.path,
                             MergePick::Any => src_major.path,
                         };
-                        let src = TimeStampedPathCopy {
+                        let src = CopySource {
                             rev: current_merge,
                             path,
                         };
@@ -654,7 +654,7 @@ 
                             MergePick::Minor => src_major.path,
                             MergePick::Any => src_major.path,
                         };
-                        let src = TimeStampedPathCopy {
+                        let src = CopySource {
                             rev: current_merge,
                             path,
                         };
@@ -673,10 +673,10 @@ 
         let mut override_minor = Vec::new();
         let mut override_major = Vec::new();
 
-        let mut to_major = |k: &PathToken, v: &TimeStampedPathCopy| {
+        let mut to_major = |k: &PathToken, v: &CopySource| {
             override_major.push((k.clone(), v.clone()))
         };
-        let mut to_minor = |k: &PathToken, v: &TimeStampedPathCopy| {
+        let mut to_minor = |k: &PathToken, v: &CopySource| {
             override_minor.push((k.clone(), v.clone()))
         };
 
@@ -713,7 +713,7 @@ 
                             // anything (but diff should not have yield them)
                             MergePick::Any => src_major.path,
                         };
-                        let src = TimeStampedPathCopy {
+                        let src = CopySource {
                             rev: current_merge,
                             path,
                         };
@@ -773,8 +773,8 @@ 
     changes: &ChangedFiles,
     oracle: &mut AncestorOracle<A>,
     dest: &PathToken,
-    src_minor: &TimeStampedPathCopy,
-    src_major: &TimeStampedPathCopy,
+    src_minor: &CopySource,
+    src_major: &CopySource,
 ) -> (MergePick, bool) {
     if src_major.rev == current_merge {
         if src_minor.rev == current_merge {