diff options
author | Mike Frysinger <vapier@google.com> | 2021-05-05 15:53:03 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-05-06 19:09:16 +0000 |
commit | 5291eafa412117b80ebbf645fc51559dd0b2caaf (patch) | |
tree | f92dd1030f36cbf8aaa3c208bee7b94cd9c72927 /main.py | |
parent | 8e768eaaa722a99405f6542ac718880c8c22f060 (diff) | |
download | git-repo-5291eafa412117b80ebbf645fc51559dd0b2caaf.tar.gz |
ssh: move all ssh logic to a common place
We had ssh logic sprinkled between two git modules, and neither was
quite the right home for it. This largely moves the logic as-is to
its new home. We'll leave major refactoring to followup commits.
Bug: https://crbug.com/gerrit/12389
Change-Id: I300a8f7dba74f2bd132232a5eb1e856a8490e0e9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305483
Reviewed-by: Chris Mcdonald <cjmcdonald@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -39,7 +39,7 @@ from color import SetDefaultColoring | |||
39 | import event_log | 39 | import event_log |
40 | from repo_trace import SetTrace | 40 | from repo_trace import SetTrace |
41 | from git_command import user_agent | 41 | from git_command import user_agent |
42 | from git_config import init_ssh, close_ssh, RepoConfig | 42 | from git_config import RepoConfig |
43 | from git_trace2_event_log import EventLog | 43 | from git_trace2_event_log import EventLog |
44 | from command import InteractiveCommand | 44 | from command import InteractiveCommand |
45 | from command import MirrorSafeCommand | 45 | from command import MirrorSafeCommand |
@@ -56,6 +56,7 @@ from error import RepoChangedException | |||
56 | import gitc_utils | 56 | import gitc_utils |
57 | from manifest_xml import GitcClient, RepoClient | 57 | from manifest_xml import GitcClient, RepoClient |
58 | from pager import RunPager, TerminatePager | 58 | from pager import RunPager, TerminatePager |
59 | import ssh | ||
59 | from wrapper import WrapperPath, Wrapper | 60 | from wrapper import WrapperPath, Wrapper |
60 | 61 | ||
61 | from subcmds import all_commands | 62 | from subcmds import all_commands |
@@ -592,7 +593,7 @@ def _Main(argv): | |||
592 | repo = _Repo(opt.repodir) | 593 | repo = _Repo(opt.repodir) |
593 | try: | 594 | try: |
594 | try: | 595 | try: |
595 | init_ssh() | 596 | ssh.init() |
596 | init_http() | 597 | init_http() |
597 | name, gopts, argv = repo._ParseArgs(argv) | 598 | name, gopts, argv = repo._ParseArgs(argv) |
598 | run = lambda: repo._Run(name, gopts, argv) or 0 | 599 | run = lambda: repo._Run(name, gopts, argv) or 0 |
@@ -604,7 +605,7 @@ def _Main(argv): | |||
604 | else: | 605 | else: |
605 | result = run() | 606 | result = run() |
606 | finally: | 607 | finally: |
607 | close_ssh() | 608 | ssh.close() |
608 | except KeyboardInterrupt: | 609 | except KeyboardInterrupt: |
609 | print('aborted by user', file=sys.stderr) | 610 | print('aborted by user', file=sys.stderr) |
610 | result = 1 | 611 | result = 1 |