Skip to content

Commit 1f73587

Browse files
olivroyjennybc
andauthored
Remove some git /github related defunct functions (#1980)
* Remove defunct functions `browse_github_token()`, `browse_github_pat()`, `github_token()`, `pr_sync()`, and `pr_pull_upstream()`. * Add news + adjust pkgdown + add redirects --------- Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
1 parent 1909b25 commit 1f73587

File tree

7 files changed

+27
-120
lines changed

7 files changed

+27
-120
lines changed

NAMESPACE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export(browse_cran)
1111
export(browse_github)
1212
export(browse_github_actions)
1313
export(browse_github_issues)
14-
export(browse_github_pat)
1514
export(browse_github_pulls)
16-
export(browse_github_token)
1715
export(browse_package)
1816
export(browse_project)
1917
export(browse_travis)
@@ -45,7 +43,6 @@ export(git_protocol)
4543
export(git_remotes)
4644
export(git_sitrep)
4745
export(git_vaccinate)
48-
export(github_token)
4946
export(issue_close_community)
5047
export(issue_reprex_needed)
5148
export(local_project)
@@ -56,10 +53,8 @@ export(pr_init)
5653
export(pr_merge_main)
5754
export(pr_pause)
5855
export(pr_pull)
59-
export(pr_pull_upstream)
6056
export(pr_push)
6157
export(pr_resume)
62-
export(pr_sync)
6358
export(pr_view)
6459
export(proj_activate)
6560
export(proj_get)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# usethis (development version)
22

3+
* `browse_github_token()`, `browse_github_pat()`, and `github_token()` have been removed after being deprecated in usethis 2.0.0. `create_github_token()`, `gh::gh_token()`, and `gh_token_help()` should be used instead.
4+
5+
* `pr_pull_upstream()` and `pr_sync()` have been removed after being deprecated in usethis 2.0.0. `pr_merge_main()` and `pr_push()` should be used instead.
6+
37
* `pr_merge_main()` now offers the choice to not open the files with merge conflicts (@olivroy, #1720).
48

59
* `edit_rstudio_snippets()` now accepts yaml snippets (@olivroy, #1941).

R/usethis-defunct.R

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,12 @@
1-
#' Defunct PR functions
1+
#' Deprecated Git functions
22
#'
33
#' @description
4-
#' `r lifecycle::badge("defunct")`
5-
#'
6-
#' * `pr_pull_upstream()` has been replaced by [pr_merge_main()].
7-
#' * `pr_sync()` has been replaced by [pr_pull()] + [pr_merge_main()] + [pr_push()]
8-
#'
9-
#' @keywords internal
10-
#' @export
11-
pr_pull_upstream <- function() {
12-
lifecycle::deprecate_stop(
13-
when = "2.0.0",
14-
what = "pr_pull_upstream()",
15-
with = "pr_merge_main()",
16-
)
17-
}
18-
19-
#' @rdname pr_pull_upstream
20-
#' @export
21-
pr_sync <- function() {
22-
lifecycle::deprecate_stop(
23-
when = "2.0.0",
24-
what = "pr_sync()",
25-
details = "Sync a PR with:`pr_pull(); pr_merge_main(); pr_push();`"
26-
)
27-
}
28-
29-
#' Defunct GitHub functions
30-
#'
31-
#' @description
32-
#' `r lifecycle::badge("defunct")`
4+
#' `r lifecycle::badge("deprecated")`
335
#'
34-
#' * `browse_github_token()` and `browse_github_pat()` have been replaced by
35-
#' [create_github_token()].
36-
#' * `github_token()` has been replaced by [gh::gh_token()]
376
#' * `git_branch_default()` has been replaced by [git_default_branch()].
387
#'
398
#' @keywords internal
409
#' @export
41-
browse_github_token <- function(...) {
42-
lifecycle::deprecate_stop(
43-
when = "2.0.0",
44-
what = "browse_github_token()",
45-
with = "create_github_token()"
46-
)
47-
}
48-
49-
#' @rdname browse_github_token
50-
#' @export
51-
browse_github_pat <- function(...) {
52-
lifecycle::deprecate_stop(
53-
"2.0.0",
54-
what = "browse_github_pat()",
55-
with = "create_github_token()"
56-
)
57-
}
58-
59-
#' @rdname browse_github_token
60-
#' @export
61-
github_token <- function() {
62-
details <- glue("
63-
Call `gh::gh_token()` to retrieve a GitHub personal access token.
64-
Call `usethis::gh_token_help()` if you need help getting or configuring \\
65-
your token.")
66-
lifecycle::deprecate_stop(
67-
"2.0.0",
68-
what = "github_token()",
69-
details = details
70-
)
71-
}
72-
73-
#' @rdname browse_github_token
74-
#' @export
7510
git_branch_default <- function() {
7611
lifecycle::deprecate_soft("2.1.0", "git_branch_default()", "git_default_branch()")
7712
git_default_branch()

_pkgdown.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ reference:
164164
<img src='figures/lifecycle-deprecated.svg' alt='Deprecated lifecycle'/>
165165
</a>
166166
contents:
167-
- browse_github_token
168167
- git_credentials
169-
- pr_pull_upstream
168+
- git_branch_default
170169
- use_github_actions
171170
- use_tidy_labels
172171
- use_travis
@@ -188,3 +187,8 @@ articles:
188187
contents:
189188
- articles/ui-cli-conversion
190189
- articles/badge-accessibility
190+
191+
redirects:
192+
- ["reference/browse_github_pat.html", "reference/github-token.html"]
193+
- ["reference/pr_pull_upstream.html","reference/pull-requests.html"]
194+
- ["reference/browse_github_token.html", "reference/github-token.html"]

man/browse_github_token.Rd

Lines changed: 0 additions & 27 deletions
This file was deleted.

man/git_branch_default.Rd

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pr_pull_upstream.Rd

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)