Skip to content

Commit

Permalink
Merge pull request #4 from ganwell/t/update_80c4
Browse files Browse the repository at this point in the history
fix bug and update dependencies
  • Loading branch information
Jean-Louis Fuchs authored May 31, 2023
2 parents 39d2454 + cdfa28f commit 126bfd0
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 81 deletions.
5 changes: 5 additions & 0 deletions git_darcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def checkout(rev):

def is_ancestor(rev, last):
"""Check if revisiion can fast-forward."""
# I don't know why git thinks revs are their own ancestor
if rev == last:
return False
try:
run(["git", "merge-base", "--is-ancestor", last, rev], check=True)
return True
Expand Down Expand Up @@ -346,6 +349,7 @@ def get_head():

def record_all(rev, *, last=None, postfix=None, comments=None):
"""Record all change onto the darcs-repo."""
assert rev != last
msgs = onelines(rev, last=last)
msg = msgs[0]
comments = "\n".join(msgs[1:])
Expand Down Expand Up @@ -420,6 +424,7 @@ def get_rev_list(head, base):
while line := res.stdout.readline():
yield line.decode("UTF-8").strip()


def get_base():
"""Get the root/base commit from git."""
base = (
Expand Down
Loading

0 comments on commit 126bfd0

Please sign in to comment.