File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,15 @@ def from_line(cls, line):
80
80
""":return: New RefLogEntry instance from the given revlog line.
81
81
:param line: line without trailing newline
82
82
:raise ValueError: If line could not be parsed"""
83
- try :
84
- info , msg = line .split ('\t ' , 2 )
85
- except ValueError :
86
- raise ValueError ("line is missing tab separator" )
87
- # END handle first plit
83
+ fields = line .split ('\t ' , 1 )
84
+ if len (fields ) == 1 :
85
+ info , msg = fields [0 ], None
86
+ elif len (fields ) == 2 :
87
+ info , msg = fields
88
+ else :
89
+ raise ValueError ("Line must have up to two TAB-separated fields."
90
+ " Got %s" % repr (line ))
91
+ # END handle first split
88
92
oldhexsha = info [:40 ]
89
93
newhexsha = info [41 :81 ]
90
94
for hexsha in (oldhexsha , newhexsha ):
You can’t perform that action at this time.
0 commit comments