Skip to content

Commit 151cd69

Browse files
committed
typo
1 parent bb9d42a commit 151cd69

File tree

1 file changed

+11
-35
lines changed

1 file changed

+11
-35
lines changed

gitfeatures/core.py

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ def _call(args):
1717
try:
1818
return check_output(args).decode("utf-8")
1919
except CalledProcessError:
20-
sys.exit(
21-
__name__ + ": none zero exit status executing: " + " ".join(args)
22-
) # noqa
20+
sys.exit(__name__ + ": none zero exit status executing: " + " ".join(args)) # noqa
2321

2422

2523
def _get_branch_name(prefix, name):
@@ -44,9 +42,7 @@ def new_feature(name, prefix):
4442
new_branch = _get_branch_name(prefix, name)
4543

4644
if _branch_exists(new_branch):
47-
sys.exit(
48-
__name__ + ": local or remote branch already exists: " + new_branch
49-
) # noqa
45+
sys.exit(__name__ + ": local or remote branch already exists: " + new_branch) # noqa
5046

5147
_call(["git", "checkout", "-b", new_branch])
5248
_call(["git", "push", "-u", "origin", new_branch + ":" + new_branch])
@@ -63,15 +59,11 @@ def finish_feature(name, prefix):
6359
branch = cur_branch
6460
_call(["git", "checkout", master_branch])
6561
else:
66-
sys.exit(
67-
__name__ + ": please provide a branch name if on {}".format(master_branch)
68-
)
62+
sys.exit(__name__ + ": please provide a branch name if on {}".format(master_branch))
6963

7064
_call(["git", "remote", "update", "origin"])
7165

72-
commits = _call(
73-
["git", "log", "--oneline", branch, "^origin/{}".format(master_branch)]
74-
)
66+
commits = _call(["git", "log", "--oneline", branch, "^origin/{}".format(master_branch)])
7567
if commits:
7668
sys.exit(
7769
__name__
@@ -99,9 +91,7 @@ def _branch_func(branch_type, args):
9991

10092
branches = _get_branches(branch_type)
10193
if len(branches) > 3:
102-
print(
103-
f"you have more than 3 {branch_type} branches, shall I delete the eldest one? [y/n]"
104-
) # noqa
94+
print(f"you have more than 3 {branch_type} branches, shall I delete the eldest one? [y/n]") # noqa
10595
if input().lower() == "y":
10696
branch = branches[0]
10797
_call(["git", "push", "origin", "--delete", branch])
@@ -135,14 +125,10 @@ def pullrequest(args):
135125

136126
# check its up to date with remote master if not pull
137127
_call(["git", "remote", "update", "origin"])
138-
commits = _call(
139-
["git", "log", "--oneline", "^" + branch, "origin/{}".format(master_branch)]
140-
)
128+
commits = _call(["git", "log", "--oneline", "^" + branch, "origin/{}".format(master_branch)])
141129
if commits:
142130
print(
143-
"Your branch is behind origin/{} so cannot be automatically {}d.".format(
144-
merge_strategy, master_branch
145-
)
131+
"Your branch is behind origin/{} so cannot be automatically {}d.".format(master_branch, merge_strategy)
146132
) # noqa
147133
print(commits)
148134
print(
@@ -156,15 +142,9 @@ def pullrequest(args):
156142
_call(["git", "checkout", branch])
157143
try:
158144
print("git {} {}".format(merge_strategy, master_branch))
159-
output = check_output(["git", merge_strategy, master_branch]).decode(
160-
"utf-8"
161-
)
145+
output = check_output(["git", merge_strategy, master_branch]).decode("utf-8")
162146
print(output)
163-
print(
164-
"Congratulations, successfully {}d {}".format(
165-
merge_strategy, master_branch
166-
)
167-
)
147+
print("Congratulations, successfully {}d {}".format(merge_strategy, master_branch))
168148
except CalledProcessError as e:
169149
if "CONFLICT" in e.output:
170150
err = (
@@ -187,9 +167,7 @@ def pullrequest(args):
187167
origin = _call(["git", "config", "--get", "remote.origin.url"])
188168
name = origin.split(":")[1].replace(".git\n", "")
189169
url = _get_pullrequest_url(name, branch)
190-
if (len(args) > 0 and args[0] == "--dry-run") or os.environ.get(
191-
"CONSOLEONLY", False
192-
): # noqa
170+
if (len(args) > 0 and args[0] == "--dry-run") or os.environ.get("CONSOLEONLY", False): # noqa
193171
print(url)
194172
else:
195173
webbrowser.open_new_tab(url)
@@ -200,9 +178,7 @@ def _get_pullrequest_url(name, branch):
200178
if repo == "github":
201179
url = "https://github.com/" + name + "/pull/new/" + branch
202180
elif repo == "bitbucket":
203-
url = (
204-
"https://bitbucket.org/" + name + "/pull-requests/new?t=1&source=" + branch
205-
) # noqa
181+
url = "https://bitbucket.org/" + name + "/pull-requests/new?t=1&source=" + branch # noqa
206182
return url
207183

208184

0 commit comments

Comments
 (0)