You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to reset HEAD~1 --hard , so reset to a specific revision / drop the last commit.
Right now it's not clear to me how to pass the revision to the Dolt.reset() method.
A possible solution could be adding the revision as the first parameter (not passing via kwargs) and appending it to args before --soft / --hard :
defreset(
self,
revision: str,
tables: Union[str, List[str]] = [],
hard: bool=False,
soft: bool=False,
**kwargs,
):
""" Reset a table or set of tables that have changes in the working set to their value at the tip of the current branch. :param tables: :param hard: :param soft: :return: """ifnotisinstance(tables, (str, list)):
raiseValueError(
f"tables should be: Union[str, List[str]]; found {type(tables)}"
)
to_reset=to_list(tables)
args= ["reset"]
ifhardandsoft:
raiseValueError("Specify one of: hard=True, soft=True")
if (hardorsoft) andto_reset:
raiseValueError("Specify either hard/soft flag, or tables to reset")
args.append(revision)
ifhard:
args.append("--hard")
elifsoft:
args.append("--soft")
elifnottables:
args.append("--soft")
else:
args+=to_resetself.execute(args, **kwargs)
The text was updated successfully, but these errors were encountered:
I would like to
reset HEAD~1 --hard
, so reset to a specific revision / drop the last commit.Right now it's not clear to me how to pass the revision to the
Dolt.reset()
method.A possible solution could be adding the revision as the first parameter (not passing via kwargs) and appending it to
args
before--soft
/--hard
:The text was updated successfully, but these errors were encountered: