Skip to content

Commit 0720b4e

Browse files
committed
move dirs
1 parent 538292e commit 0720b4e

34 files changed

+96
-14898
lines changed

src/ghstack/cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def land(force: bool, pull_request: str) -> None:
141141
github_url=config.github_url,
142142
remote_name=config.remote_name,
143143
force=force,
144+
repo_default_branch_opt=config.repo_default_branch,
144145
)
145146

146147

@@ -271,6 +272,11 @@ def submit(
271272
revs=revs,
272273
stack=stack,
273274
direct_opt=direct_opt,
275+
repo_name_opt=config.repo_name,
276+
repo_owner_opt=config.repo_owner,
277+
repo_is_fork_opt=config.repo_is_fork,
278+
repo_id_opt=config.repo_id,
279+
repo_default_branch_opt=config.repo_default_branch,
274280
)
275281

276282

@@ -287,4 +293,5 @@ def unlink(commits: List[str]) -> None:
287293
sh=shell,
288294
github_url=config.github_url,
289295
remote_name=config.remote_name,
296+
repo_default_branch_opt=config.repo_default_branch,
290297
)

src/ghstack/config.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
("github_url", str),
4141
# Name of the upstream remote
4242
("remote_name", str),
43+
# Repository name
44+
("repo_name", Optional[str]),
45+
# Repository owner / organisation
46+
("repo_owner", Optional[str]),
47+
# Whether the repo is a fork
48+
("repo_is_fork", Optional[str]),
49+
# Numeric GitHub repository ID
50+
("repo_id", Optional[str]),
51+
# Default branch name (e.g. "main")
52+
("repo_default_branch", Optional[str]),
4353
],
4454
)
4555

@@ -208,6 +218,26 @@ def read_config(
208218
config.write(f)
209219
logging.info("NB: configuration saved to {}".format(config_path))
210220

221+
repo_name = None
222+
if config.has_option("repo", "name"):
223+
repo_name = config.get("repo", "name")
224+
225+
repo_owner = None
226+
if config.has_option("repo", "owner"):
227+
repo_owner = config.get("repo", "owner")
228+
229+
repo_is_fork = None
230+
if config.has_option("repo", "is_fork"):
231+
repo_is_fork = config.getboolean("repo", "is_fork")
232+
233+
repo_id = None
234+
if config.has_option("repo", "id"):
235+
repo_id = config.get("repo", "id")
236+
237+
repo_default_branch = None
238+
if config.has_option("repo", "default_branch"):
239+
repo_default_branch = config.get("repo", "default_branch")
240+
211241
conf = Config(
212242
github_oauth=github_oauth,
213243
circle_token=circle_token,
@@ -218,6 +248,11 @@ def read_config(
218248
default_project_dir=default_project_dir,
219249
github_url=github_url,
220250
remote_name=remote_name,
251+
repo_name=repo_name,
252+
repo_owner=repo_owner,
253+
repo_is_fork=repo_is_fork,
254+
repo_id=repo_id,
255+
repo_default_branch=repo_default_branch,
221256
)
222257
logging.debug(f"conf = {conf}")
223258
return conf

src/ghstack/ghstack/__init__.py

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

src/ghstack/ghstack/__main__.py

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

src/ghstack/ghstack/action.py

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

src/ghstack/ghstack/cache.py

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

src/ghstack/ghstack/checkout.py

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

src/ghstack/ghstack/circleci.py

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

src/ghstack/ghstack/circleci_real.py

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

0 commit comments

Comments
 (0)