Skip to content

use cache_dir by default: ~/.cache/svn2github #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdg
18 changes: 16 additions & 2 deletions svn2github.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import shutil
import sys
import argparse
import xdg
import inspect


class Svn2GithubException(Exception):
Expand Down Expand Up @@ -157,8 +159,20 @@ def sync_github_mirror(github_repo, cache_dir, new_svn_url=None):


def main():
parser = argparse.ArgumentParser(description="Mirror SVN repositories to GitHub")
parser.add_argument("--cache-dir", help="Directory to keep the cached data to avoid re-downloading all SVN and Git history each time. This is optional, but highly recommended")
parser = argparse.ArgumentParser(
description="Mirror SVN repositories to GitHub",
formatter_class=argparse.RawTextHelpFormatter
)
default_cache_dir = xdg.xdg_cache_home() / "svn2github"
parser.add_argument(
"--cache-dir",
help=inspect.cleandoc(f"""
Directory to keep the cached data,
to avoid re-downloading all SVN and Git history each time.
Default: {default_cache_dir}
"""),
default=default_cache_dir
)
subparsers = parser.add_subparsers()

subparser_import = subparsers.add_parser("import", help="Import SVN repository to the GitHub repo")
Expand Down