File tree 1 file changed +12
-3
lines changed 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1938,6 +1938,7 @@ def get_ghstack_dependent_prs(
1938
1938
1939
1939
def do_revert_prs (
1940
1940
repo : GitRepo ,
1941
+ original_pr : GitHubPR ,
1941
1942
shas_and_prs : list [tuple [str , GitHubPR ]],
1942
1943
* ,
1943
1944
author_login : str ,
@@ -1959,9 +1960,16 @@ def do_revert_prs(
1959
1960
1960
1961
# Comment/reopen PRs
1961
1962
for commit_sha , pr in shas_and_prs :
1962
- revert_message = (
1963
- f"@{ pr .get_pr_creator_login ()} your PR has been successfully reverted."
1964
- )
1963
+ revert_message = ""
1964
+ if pr .pr_num == original_pr .pr_num :
1965
+ revert_message += (
1966
+ f"@{ pr .get_pr_creator_login ()} your PR has been successfully reverted."
1967
+ )
1968
+ else :
1969
+ revert_message += (
1970
+ f"@{ pr .get_pr_creator_login ()} your PR has been reverted as part of the stack under "
1971
+ f"#{ original_pr .pr_num } .\n "
1972
+ )
1965
1973
if (
1966
1974
pr .has_internal_changes ()
1967
1975
and not pr .has_no_connected_diff ()
@@ -2013,6 +2021,7 @@ def try_revert(
2013
2021
2014
2022
do_revert_prs (
2015
2023
repo ,
2024
+ pr ,
2016
2025
shas_and_prs ,
2017
2026
author_login = author_login ,
2018
2027
extra_msg = extra_msg ,
You can’t perform that action at this time.
0 commit comments