Commit a7a5bba
Don't let reordering a stack mark pull requests as merged
In direct mode a pull request's base is another pull request's head
branch. Reordering a stack makes the branch a pull request used to be
based on merge that pull request's head in, and every branch is pushed
before any base is retargeted, so GitHub sees a head reachable from the
base it still has on file and closes that pull request as merged. Merged
pull requests cannot be reopened.
Retargeting before pushing does not fix it: in a swap, the pull request
moving the other way is already reachable from the base it is about to be
given. Park every pull request whose base is moving on the default
branch first instead, which no head branch is reachable from. Costs one
extra API call and two base-change timeline entries per moved pull
request.
github_fake now closes a pull request as merged when its head becomes
reachable from its base, which is what lets reorder.py.test catch this.1 parent f4e9df5 commit a7a5bba
3 files changed
Lines changed: 78 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
135 | 154 | | |
136 | 155 | | |
137 | 156 | | |
| |||
140 | 159 | | |
141 | 160 | | |
142 | 161 | | |
| 162 | + | |
143 | 163 | | |
144 | 164 | | |
145 | 165 | | |
| |||
275 | 295 | | |
276 | 296 | | |
277 | 297 | | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
342 | 363 | | |
343 | 364 | | |
344 | 365 | | |
| 366 | + | |
345 | 367 | | |
346 | 368 | | |
347 | 369 | | |
| |||
419 | 441 | | |
420 | 442 | | |
421 | 443 | | |
| 444 | + | |
422 | 445 | | |
423 | 446 | | |
424 | 447 | | |
| |||
463 | 486 | | |
464 | 487 | | |
465 | 488 | | |
| 489 | + | |
466 | 490 | | |
467 | 491 | | |
468 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2005 | 2005 | | |
2006 | 2006 | | |
2007 | 2007 | | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
2008 | 2027 | | |
2009 | 2028 | | |
2010 | 2029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments