mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 22:47:26 +03:00
py3: drawdag: fix some types
Summary: This fixed using drawdag to create merge commits. Reviewed By: xavierd Differential Revision: D19697893 fbshipit-source-id: fac4278a54d2cf2eb2b9d8154a13edd29e1a510a
This commit is contained in:
parent
ad40d8567f
commit
a8f232e0ab
@ -272,6 +272,7 @@ def _parseasciigraph(text):
|
||||
|
||||
class simplefilectx(object):
|
||||
def __init__(self, path, data, renamed=None):
|
||||
assert isinstance(data, bytes)
|
||||
self._data = data
|
||||
self._path = path
|
||||
self._renamed = renamed
|
||||
@ -299,6 +300,7 @@ class simplecommitctx(context.committablectx):
|
||||
added = []
|
||||
removed = []
|
||||
for path, data in filemap.items():
|
||||
assert isinstance(data, str)
|
||||
# check "(renamed from)". mark the source as removed
|
||||
m = re.search("\(renamed from (.+)\)\s*\Z", data, re.S)
|
||||
if m:
|
||||
@ -555,7 +557,7 @@ def drawdag(repo, text, **opts):
|
||||
# If it's a merge, take the files and contents from the parents
|
||||
for f in pctxs[1].manifest():
|
||||
if f not in pctxs[0].manifest():
|
||||
added[f] = pctxs[1][f].data()
|
||||
added[f] = pycompat.decodeutf8(pctxs[1][f].data())
|
||||
else:
|
||||
# If it's not a merge, add a single file, if defaultfiles is set
|
||||
if defaultfiles:
|
||||
|
@ -1,4 +1,3 @@
|
||||
#require py2
|
||||
#chg-compatible
|
||||
|
||||
TODO: configure mutation
|
||||
|
Loading…
Reference in New Issue
Block a user