• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A categorical programming language


Commit MetaInfo

Revisão0c80c0279698f2fe155f39a53245cd05fa6f4e28 (tree)
Hora2024-11-13 11:24:51
AutorCorbin <cds@corb...>
CommiterCorbin

Mensagem de Log

bk: With a flag, allow updating refs.

I was able to use this to programmatically update all of the demo
animation refs to use the new API.

Mudança Sumário

Diff

--- a/bk/bk.py
+++ b/bk/bk.py
@@ -232,12 +232,14 @@ def apply(hive, template, arguments, j):
232232 @cli.command()
233233 @HIVE_OPT
234234 @click.option("-j", is_flag=True)
235+@click.option("-y", is_flag=True, help="Overwrite existing refs")
235236 @click.option("--author", default="Unknown")
236237 @click.option("--trail", default="")
237238 @click.argument("name")
238-def insert(hive, name, j, author, trail):
239+def insert(hive, name, j, y, author, trail):
239240 ref = b"refs/local/" + name.encode("utf-8")
240- if ref in hive.refs: raise ValueError("Ref already in hive!")
241+ if ref in hive.refs and not y:
242+ raise ValueError("Ref already in hive (pass -y to override")
241243 if j: expr = json.load(sys.stdin)
242244 else: expr, trail = parse(sys.stdin.read())
243245 author = author.encode("utf-8")