comparison rust/hg-core/src/matchers.rs @ 51700:7f0cb9ee0534

Backout accidental publication of a large range of revisions I accidentally published 25e7f9dcad0f::bd1483fd7088, this is the inverse.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 23 Jul 2024 10:02:46 +0200
parents 918ceb5a3d25
children ec7171748350
comparison
equal deleted inserted replaced
51699:bd1483fd7088 51700:7f0cb9ee0534
615 let files = if m1.is_exact() || m2.is_exact() { 615 let files = if m1.is_exact() || m2.is_exact() {
616 if !m1.is_exact() { 616 if !m1.is_exact() {
617 std::mem::swap(&mut m1, &mut m2); 617 std::mem::swap(&mut m1, &mut m2);
618 } 618 }
619 m1.file_set().map(|m1_files| { 619 m1.file_set().map(|m1_files| {
620 m1_files 620 m1_files.iter().cloned().filter(|f| m2.matches(f)).collect()
621 .iter()
622 .filter(|&f| m2.matches(f))
623 .cloned()
624 .collect()
625 }) 621 })
626 } else { 622 } else {
627 // without exact input file sets, we can't do an exact 623 // without exact input file sets, we can't do an exact
628 // intersection, so we must over-approximate by 624 // intersection, so we must over-approximate by
629 // unioning instead 625 // unioning instead
712 excluded, 708 excluded,
713 files: None, 709 files: None,
714 }; 710 };
715 if base_is_exact { 711 if base_is_exact {
716 new.files = base_files.map(|files| { 712 new.files = base_files.map(|files| {
717 files.iter().filter(|&f| new.matches(f)).cloned().collect() 713 files.iter().cloned().filter(|f| new.matches(f)).collect()
718 }); 714 });
719 } 715 }
720 new 716 new
721 } 717 }
722 } 718 }