Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changes

### 4.0.1 (unreleased)

- Fix specifying out a revision (#40)
[pbauer]

### 4.0.0 (2024-02-28)

- Breaking: Remove `--pre` on sources from generated `requirements-mxdev.txt`.
Expand Down
22 changes: 13 additions & 9 deletions src/mxdev/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ def __init__(self, source: typing.Dict[str, str]):
if "revision" in source:
source["rev"] = source["revision"]
del source["revision"]
if "branch" in source and "rev" in source:
logger.error(
"Cannot specify both branch (%s) and rev/revision "
"(%s) in source for %s",
source["branch"],
source["rev"],
source["name"],
)
sys.exit(1)
if "rev" in source:
# drop default value for branch if rev is specified
if source.get("branch") == "main":
del source["branch"]
elif "branch" in source:
logger.error(
"Cannot specify both branch (%s) and rev/revision "
"(%s) in source for %s",
source["branch"],
source["rev"],
source["name"],
)
sys.exit(1)
super().__init__(source)

@functools.lru_cache(maxsize=4096)
Expand Down