diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sub_commands/prs/create.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sub_commands/prs/create.rs b/src/sub_commands/prs/create.rs index e85611f..655978e 100644 --- a/src/sub_commands/prs/create.rs +++ b/src/sub_commands/prs/create.rs | |||
| @@ -298,6 +298,9 @@ mod tests_unique_and_duplicate { | |||
| 298 | } | 298 | } |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | pub static PR_KIND: u64 = 318; | ||
| 302 | pub static PATCH_KIND: u64 = 317; | ||
| 303 | |||
| 301 | fn generate_pr_and_patch_events( | 304 | fn generate_pr_and_patch_events( |
| 302 | title: &String, | 305 | title: &String, |
| 303 | description: &String, | 306 | description: &String, |
| @@ -311,9 +314,9 @@ fn generate_pr_and_patch_events( | |||
| 311 | .context("failed to get root commit of the repository")?; | 314 | .context("failed to get root commit of the repository")?; |
| 312 | 315 | ||
| 313 | let pr_event = EventBuilder::new( | 316 | let pr_event = EventBuilder::new( |
| 314 | nostr::event::Kind::Custom(318), | 317 | nostr::event::Kind::Custom(PR_KIND), |
| 315 | format!("{title}\r\n\r\n{description}"), | 318 | format!("{title}\r\n\r\n{description}"), |
| 316 | &[Tag::Hashtag(format!("r-{root_commit}"))], | 319 | &[Tag::Reference(format!("r-{root_commit}"))], |
| 317 | // TODO: suggested branch name | 320 | // TODO: suggested branch name |
| 318 | // Tag::Generic( | 321 | // Tag::Generic( |
| 319 | // TagKind::Custom("suggested-branch-name".to_string()), | 322 | // TagKind::Custom("suggested-branch-name".to_string()), |
| @@ -335,14 +338,14 @@ fn generate_pr_and_patch_events( | |||
| 335 | .context("failed to create patch event")?; | 338 | .context("failed to create patch event")?; |
| 336 | events.push( | 339 | events.push( |
| 337 | EventBuilder::new( | 340 | EventBuilder::new( |
| 338 | nostr::event::Kind::Custom(317), | 341 | nostr::event::Kind::Custom(PATCH_KIND), |
| 339 | git_repo | 342 | git_repo |
| 340 | .make_patch_from_commit(commit) | 343 | .make_patch_from_commit(commit) |
| 341 | .context(format!("cannot make patch for commit {commit}"))?, | 344 | .context(format!("cannot make patch for commit {commit}"))?, |
| 342 | &[ | 345 | &[ |
| 343 | Tag::Hashtag(format!("r-{root_commit}")), | 346 | Tag::Reference(format!("r-{root_commit}")), |
| 344 | Tag::Hashtag(commit.to_string()), | 347 | Tag::Reference(commit.to_string()), |
| 345 | Tag::Hashtag(commit_parent.to_string()), | 348 | Tag::Reference(commit_parent.to_string()), |
| 346 | Tag::Event( | 349 | Tag::Event( |
| 347 | pr_event_id, | 350 | pr_event_id, |
| 348 | None, // TODO: add relay | 351 | None, // TODO: add relay |