this repo has no description

misc improvements

+23 -18
+23 -18
src/main.rs
··· 56 56 for stack_root in graph.iter_edges_from("main") { 57 57 let mut comment_lines = Vec::new(); 58 58 write_pr_comment(&graph, stack_root, 0, &mut comment_lines); 59 - create_or_update_comments( 60 - &comment_lines, 61 - stack_root, 62 - &graph, 63 - &pulls, 64 - &octocrab, 65 - &repo_info, 66 - ) 67 - .await 68 - .context("failed to sync stack comment")?; 59 + 60 + if comment_lines.len() > 1 { 61 + // if the comment contains just one line then its not 62 + // part of a stack 63 + create_or_update_comments( 64 + &comment_lines, 65 + stack_root, 66 + &graph, 67 + &pulls, 68 + &octocrab, 69 + &repo_info, 70 + ) 71 + .await 72 + .context("failed to sync stack comment")?; 73 + } 69 74 } 70 75 71 76 Ok(()) ··· 81 86 "-r", 82 87 &format!("children({change}, 1)"), 83 88 "-T", 84 - "change_id ++ \" \" ++ bookmarks ++ \"\n\"", 89 + "change_id ++ \" \" ++ local_bookmarks ++ \"\n\"", 85 90 ], 86 91 )?; 87 92 ··· 286 291 pulls[idx] = updated; 287 292 } 288 293 } else if cli.create_new { 289 - eprintln!("creating PR from {target}<-{branch}"); 290 294 let pull = octocrab 291 295 .pulls(&repo_info.owner, &repo_info.name) 292 296 .create(branch, branch, target) ··· 294 298 .send() 295 299 .await 296 300 .with_context(|| format!("failed to create PR from {target}<-{branch}"))?; 301 + if let Some(url) = &pull.html_url { 302 + eprintln!("Created PR from {target}<-{branch}: {url}"); 303 + } else { 304 + eprintln!("Created PR from {target}<-{branch}"); 305 + } 297 306 pulls.push(pull); 298 307 } else { 299 308 eprintln!("skipping creating PR from {target}<-{branch}"); ··· 361 370 .update_comment(existing_comment.id, comment) 362 371 .await 363 372 .context("failed to update comment")?; 364 - if let Some(url) = &pull.html_url { 365 - eprintln!("updated comment on {url}"); 366 - } 373 + eprintln!("updated comment on #{}", pull.number); 367 374 } 368 375 } else { 369 376 octocrab ··· 371 378 .create_comment(pull.number, comment) 372 379 .await 373 380 .context("failed to create comment")?; 374 - if let Some(url) = &pull.html_url { 375 - eprintln!("created comment on {url}"); 376 - } 381 + eprintln!("created comment on #{}", pull.number); 377 382 } 378 383 379 384 Ok(())