|
@@ -83,7 +83,7 @@ def parse_ref(container, refspec):
|
|
|
raise KeyError(refspec)
|
|
|
|
|
|
|
|
|
-def parse_reftuple(lh_container, rh_container, refspec):
|
|
|
+def parse_reftuple(lh_container, rh_container, refspec, force=False):
|
|
|
"""Parse a reftuple spec.
|
|
|
|
|
|
Args:
|
|
@@ -98,8 +98,6 @@ def parse_reftuple(lh_container, rh_container, refspec):
|
|
|
if refspec.startswith(b"+"):
|
|
|
force = True
|
|
|
refspec = refspec[1:]
|
|
|
- else:
|
|
|
- force = False
|
|
|
if b":" in refspec:
|
|
|
(lh, rh) = refspec.split(b":")
|
|
|
else:
|
|
@@ -120,13 +118,15 @@ def parse_reftuple(lh_container, rh_container, refspec):
|
|
|
return (lh, rh, force)
|
|
|
|
|
|
|
|
|
-def parse_reftuples(lh_container, rh_container, refspecs):
|
|
|
+def parse_reftuples(
|
|
|
+ lh_container, rh_container, refspecs, force=False):
|
|
|
"""Parse a list of reftuple specs to a list of reftuples.
|
|
|
|
|
|
Args:
|
|
|
lh_container: A RefsContainer object
|
|
|
hh_container: A RefsContainer object
|
|
|
refspecs: A list of refspecs or a string
|
|
|
+ force: Force overwriting for all reftuples
|
|
|
Returns: A list of refs
|
|
|
Raises:
|
|
|
KeyError: If one of the refs can not be found
|
|
@@ -136,7 +136,8 @@ def parse_reftuples(lh_container, rh_container, refspecs):
|
|
|
ret = []
|
|
|
# TODO: Support * in refspecs
|
|
|
for refspec in refspecs:
|
|
|
- ret.append(parse_reftuple(lh_container, rh_container, refspec))
|
|
|
+ ret.append(parse_reftuple(
|
|
|
+ lh_container, rh_container, refspec, force=force))
|
|
|
return ret
|
|
|
|
|
|
|