History

merge doesn't consider user generated sections, only the ones it would want to add (#198)

Sebastian Thiel committed 5 years ago

Commit ebbebdd1 parent adfbd0d5 files · +55 −43Browse files

Unified · Split

5 files
  1. cargo-smart-release/src/changelog/merge.rs +1 −1
  2. cargo-smart-release/src/changelog/mod.rs +0 −9
  3. cargo-smart-release/src/changelog/section/mod.rs +9 −0
  4. cargo-smart-release/tests/changelog/merge.rs +13 −2
  5. git-repository/CHANGELOG.md +32 −31
cargo-smart-release/src/changelog/merge.rs+1−1
@@ -70,7 +70,7 @@ fn merge_section(dest: &mut Section, src: Section) { · 69 unmodified lines
70 },70 },
71 ) => {71 ) => {
72 assert!(rhs_unknown.is_empty(), "shouldn't ever generate 'unknown' portions");72 assert!(rhs_unknown.is_empty(), "shouldn't ever generate 'unknown' portions");
73 let mode = if lhs_segments.is_empty() {73 let mode = if !lhs_segments.iter().any(|s| s.is_read_only()) {
74 ReplaceMode::ReplaceAllOrAppend74 ReplaceMode::ReplaceAllOrAppend
75 } else {75 } else {
76 ReplaceMode::ReplaceAllOrAppendIfPresentInLhs76 ReplaceMode::ReplaceAllOrAppendIfPresentInLhs
cargo-smart-release/src/changelog/mod.rs+0−9
@@ -76,12 +76,3 @@ impl Section { · 75 unmodified lines
76 }76 }
77 }77 }
78}78}
79
80impl section::Segment {
81 pub fn is_read_only(&self) -> bool {
82 match self {
83 section::Segment::User { .. } | section::Segment::Conventional { .. } => false,
84 section::Segment::Clippy(_) | section::Segment::Statistics(_) | section::Segment::Details(_) => true,
85 }
86 }
87}
cargo-smart-release/src/changelog/section/mod.rs+9−0
@@ -27,3 +27,12 @@ impl<T: PartialEq<T>> PartialEq<Data<T>> for Data<T> { · 26 unmodified lines
27 }27 }
28 }28 }
29}29}
30
31impl Segment {
32 pub fn is_read_only(&self) -> bool {
33 match self {
34 Segment::User { .. } | Segment::Conventional { .. } => false,
35 Segment::Clippy(_) | Segment::Statistics(_) | Segment::Details(_) => true,
36 }
37 }
38}
cargo-smart-release/tests/changelog/merge.rs+13−2
@@ -163,7 +163,9 @@ fn into_previously_generated_with_removed_statistical_segments() { · 162 unmodified lines
163 .assume_utc(),163 .assume_utc(),
164 ),164 ),
165 name: changelog::Version::Semantic("1.0.0".parse().unwrap()),165 name: changelog::Version::Semantic("1.0.0".parse().unwrap()),
166 segments: vec![], // all segments removed166 segments: vec![section::Segment::User {
167 text: "user generated".into(),
168 }], // all segments removed, but user segment present
167 unknown: "".into(),169 unknown: "".into(),
168 },170 },
169 Section::Release {171 Section::Release {
@@ -248,7 +250,16 @@ fn into_previously_generated_with_removed_statistical_segments() { · 78 unmodified lines
248 .assume_utc(),250 .assume_utc(),
249 ),251 ),
250 name: changelog::Version::Semantic("1.0.0".parse().unwrap()),252 name: changelog::Version::Semantic("1.0.0".parse().unwrap()),
251 segments,253 segments: {
254 let mut s = segments.clone();
255 s.insert(
256 0,
257 section::Segment::User {
258 text: "user generated".into(),
259 },
260 );
261 s
262 },
252 unknown: "".into(),263 unknown: "".into(),
253 },264 },
254 Section::Release {265 Section::Release {
git-repository/CHANGELOG.md+32−31
@@ -18,10 +18,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 17 unmodified lines
18 18
19<csr-read-only-do-not-edit/>19<csr-read-only-do-not-edit/>
20 20
21 - 76 commits contributed to the release over the course of 16 calendar days.21 - 77 commits contributed to the release over the course of 18 calendar days.
22 - 34 commits where understood as [conventional](https://www.conventionalcommits.org).22 - 34 commits where understood as [conventional](https://www.conventionalcommits.org).
23 - 5 unique issues were worked on23 - 5 unique issues were worked on
24 24
25### Thanks Clippy
26
27<csr-read-only-do-not-edit/>
28
29[Clippy](https://github.com/rust-lang/rust-clippy) helped 3 times to make code idiomatic.
30
25### Commit Details31### Commit Details
26 32
27<csr-read-only-do-not-edit/>33<csr-read-only-do-not-edit/>
@@ -88,6 +94,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 60 unmodified lines
88 - Use Easy in the one spot where it is possible… (6a97bfa)94 - Use Easy in the one spot where it is possible… (6a97bfa)
89 - try to create persistent Easy iterator, but can't make it Send… (54a64a5)95 - try to create persistent Easy iterator, but can't make it Send… (54a64a5)
90 * **Uncategorized**96 * **Uncategorized**
97 - Update changelogs just for fun (fa91ba3)
91 - Merge branch 'main' into changelog-generation (c956f33)98 - Merge branch 'main' into changelog-generation (c956f33)
92 - thanks clippy (ae7826e)99 - thanks clippy (ae7826e)
93 - thanks clippy (b02edb5)100 - thanks clippy (b02edb5)
@@ -111,12 +118,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 17 unmodified lines
111 - [repository #164] (4111d22)118 - [repository #164] (4111d22)
112</details>119</details>
113 120
114### Thanks Clippy
115
116<csr-read-only-do-not-edit/>
117
118[Clippy](https://github.com/rust-lang/rust-clippy) helped 3 times to make code idiomatic.
119
120## v0.9.1 (2021-09-10)121## v0.9.1 (2021-09-10)
121 122
122- Remove `max-performance` feature from default set until the `msvc` build issue is fixed. Otherwise it will surprisingly break windows builds.123- Remove `max-performance` feature from default set until the `msvc` build issue is fixed. Otherwise it will surprisingly break windows builds.
@@ -200,6 +201,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 77 unmodified lines
200 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).201 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).
201 - 1 unique issue was worked on202 - 1 unique issue was worked on
202 203
204### Thanks Clippy
205
206<csr-read-only-do-not-edit/>
207
208[Clippy](https://github.com/rust-lang/rust-clippy) helped 3 times to make code idiomatic.
209
203### Commit Details210### Commit Details
204 211
205<csr-read-only-do-not-edit/>212<csr-read-only-do-not-edit/>
@@ -275,12 +282,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 69 unmodified lines
275 - [repository #185] refactor repository initialization… (5ff7eaa)282 - [repository #185] refactor repository initialization… (5ff7eaa)
276</details>283</details>
277 284
278### Thanks Clippy
279
280<csr-read-only-do-not-edit/>
281
282[Clippy](https://github.com/rust-lang/rust-clippy) helped 3 times to make code idiomatic.
283
284## v0.8.1 (2021-08-28)285## v0.8.1 (2021-08-28)
285 286
286- Introduce `EasyArcExclusive` type, now available thanks to `parking_lot` 0.11.2287- Introduce `EasyArcExclusive` type, now available thanks to `parking_lot` 0.11.2
@@ -316,6 +317,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 29 unmodified lines
316 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).317 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).
317 - 1 unique issue was worked on318 - 1 unique issue was worked on
318 319
320### Thanks Clippy
321
322<csr-read-only-do-not-edit/>
323
324[Clippy](https://github.com/rust-lang/rust-clippy) helped 4 times to make code idiomatic.
325
319### Commit Details326### Commit Details
320 327
321<csr-read-only-do-not-edit/>328<csr-read-only-do-not-edit/>
@@ -442,20 +449,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 120 unmodified lines
442 - [smart-release #162] FAIL: promising at first, but not really working… (fa01f76)449 - [smart-release #162] FAIL: promising at first, but not really working… (fa01f76)
443</details>450</details>
444 451
445### Thanks Clippy
446
447<csr-read-only-do-not-edit/>
448
449[Clippy](https://github.com/rust-lang/rust-clippy) helped 4 times to make code idiomatic.
450
451## v0.7.2 (2021-08-17)452## v0.7.2 (2021-08-17)
452 453
453### Thanks Clippy
454
455<csr-read-only-do-not-edit/>
456
457[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic.
458
459### Commit Statistics454### Commit Statistics
460 455
461<csr-read-only-do-not-edit/>456<csr-read-only-do-not-edit/>
@@ -464,6 +459,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 2 unmodified lines
464 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).459 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).
465 - 1 unique issue was worked on460 - 1 unique issue was worked on
466 461
462### Thanks Clippy
463
464<csr-read-only-do-not-edit/>
465
466[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic.
467
467### Commit Details468### Commit Details
468 469
469<csr-read-only-do-not-edit/>470<csr-read-only-do-not-edit/>
@@ -541,6 +542,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 71 unmodified lines
541 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).542 - 0 commits where understood as [conventional](https://www.conventionalcommits.org).
542 - 1 unique issue was worked on543 - 1 unique issue was worked on
543 544
545### Thanks Clippy
546
547<csr-read-only-do-not-edit/>
548
549[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic.
550
544### Commit Details551### Commit Details
545 552
546<csr-read-only-do-not-edit/>553<csr-read-only-do-not-edit/>
@@ -591,12 +598,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 · 44 unmodified lines
591 - (cargo-release) version 0.2.0 (3286e42)598 - (cargo-release) version 0.2.0 (3286e42)
592</details>599</details>
593 600
594### Thanks Clippy
595
596<csr-read-only-do-not-edit/>
597
598[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic.
599
600## v0.6.0 (2021-05-28)601## v0.6.0 (2021-05-28)
601 602
602### Commit Statistics603### Commit Statistics

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t