git2svn 0.6.0__tar.gz → 0.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {git2svn-0.6.0/git2svn.egg-info → git2svn-0.6.1}/PKG-INFO +1 -1
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/_version.py +2 -2
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/cli.py +6 -1
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/core.py +4 -1
- {git2svn-0.6.0 → git2svn-0.6.1/git2svn.egg-info}/PKG-INFO +1 -1
- {git2svn-0.6.0 → git2svn-0.6.1}/pyproject.toml +1 -1
- {git2svn-0.6.0 → git2svn-0.6.1}/tests/test_e2e.py +21 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.githooks/pre-commit +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.github/dependabot.yml +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.github/workflows/ci.yml +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.github/workflows/release.yml +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.gitignore +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/.pre-commit-config.yaml +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/CONTRIBUTING.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/LICENSE.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/README.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/arc42/README.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/arc42/adrs.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/arc42/concepts.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/req42.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/user-guide/README.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/user-guide/commands.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/user-guide/integration-workflow.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/docs/user-guide/troubleshooting.md +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/__init__.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/__main__.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/colors.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/eol.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/git.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/patcher.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/py.typed +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/state.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn/svn.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/SOURCES.txt +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/dependency_links.txt +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/entry_points.txt +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/requires.txt +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/scm_file_list.json +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.egg-info/top_level.txt +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/git2svn.py +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/setup.cfg +0 -0
- {git2svn-0.6.0 → git2svn-0.6.1}/tests/test_git2svn.py +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.6.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 6,
|
|
21
|
+
__version__ = version = '0.6.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 6, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -473,6 +473,11 @@ def main(argv: Optional[List[str]] = None) -> int:
|
|
|
473
473
|
|
|
474
474
|
try:
|
|
475
475
|
if args.command == "stage":
|
|
476
|
+
is_snapshot = getattr(args, "snapshot", False)
|
|
477
|
+
if not ref1 and is_snapshot:
|
|
478
|
+
ref1 = "HEAD"
|
|
479
|
+
logger.info("No ref specified for snapshot stage; defaulting to HEAD.")
|
|
480
|
+
|
|
476
481
|
if not ref1:
|
|
477
482
|
print(
|
|
478
483
|
"Error: stage requires a commit or range (e.g. 'git2svn stage main..feature') "
|
|
@@ -484,7 +489,7 @@ def main(argv: Optional[List[str]] = None) -> int:
|
|
|
484
489
|
ref1,
|
|
485
490
|
ref2,
|
|
486
491
|
use_copy=use_copy,
|
|
487
|
-
snapshot=
|
|
492
|
+
snapshot=is_snapshot,
|
|
488
493
|
)
|
|
489
494
|
elif args.command == "replay":
|
|
490
495
|
action = getattr(args, "replay_action", None)
|
|
@@ -71,7 +71,10 @@ class Synchronizer:
|
|
|
71
71
|
If use_copy=True, brute-force copies files using Git object DB (bypassing patch).
|
|
72
72
|
"""
|
|
73
73
|
if snapshot:
|
|
74
|
-
|
|
74
|
+
# If a range was supplied (e.g. origin/main..main or ref1 and ref2), snapshot targets the end ref
|
|
75
|
+
is_single, start_or_commit, end_ref = parse_ref_arguments(ref1, ref2)
|
|
76
|
+
target_ref = end_ref if not is_single and end_ref else start_or_commit
|
|
77
|
+
self.stage_snapshot(target_ref)
|
|
75
78
|
return
|
|
76
79
|
|
|
77
80
|
is_single, start_or_commit, end_ref = parse_ref_arguments(ref1, ref2)
|
|
@@ -233,6 +233,27 @@ class TestGit2SvnE2E(unittest.TestCase):
|
|
|
233
233
|
self.assertIn("D obsolete.txt", status)
|
|
234
234
|
self.assertIn("A brand_new.txt", status)
|
|
235
235
|
|
|
236
|
+
def test_e2e_snapshot_with_default_range(self):
|
|
237
|
+
"""Test snapshot stage correctly resolves target ref when defaultRange is a range (e.g. origin/main..main)."""
|
|
238
|
+
# Create base file in SVN
|
|
239
|
+
(self.svn_wc_dir / "base.txt").write_text("v1\n", encoding="utf-8")
|
|
240
|
+
subprocess.run([SVN_BIN, "add", "base.txt"], cwd=self.svn_wc_dir, check=True)
|
|
241
|
+
subprocess.run([SVN_BIN, "commit", "-m", "init"], cwd=self.svn_wc_dir, check=True)
|
|
242
|
+
|
|
243
|
+
# In Git, create base commit and feature commit
|
|
244
|
+
(self.git_dir / "base.txt").write_text("v1\n", encoding="utf-8")
|
|
245
|
+
c1 = self._git_commit("feat: c1")
|
|
246
|
+
(self.git_dir / "base.txt").write_text("v2\n", encoding="utf-8")
|
|
247
|
+
c2 = self._git_commit("feat: c2")
|
|
248
|
+
|
|
249
|
+
# Configure defaultRange as a range c1..c2
|
|
250
|
+
subprocess.run([GIT_BIN, "config", "git2svn.defaultRange", f"{c1}..{c2}"], cwd=self.git_dir, check=True)
|
|
251
|
+
|
|
252
|
+
# Run stage --snapshot without any ref (should use end ref of defaultRange: c2)
|
|
253
|
+
exit_code = cli_main(["stage", "--snapshot", "-g", str(self.git_dir), "-s", str(self.svn_wc_dir)])
|
|
254
|
+
self.assertEqual(exit_code, 0)
|
|
255
|
+
self.assertEqual((self.svn_wc_dir / "base.txt").read_text(encoding="utf-8"), "v2\n")
|
|
256
|
+
|
|
236
257
|
def test_e2e_replay_conflict_pause_and_continue(self):
|
|
237
258
|
"""Test replay pausing on a patch conflict in a real SVN WC and resuming with --continue."""
|
|
238
259
|
# 1. Base commit in Git and SVN
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|