1561 _exportsingle( |
1561 _exportsingle( |
1562 repo, ctx, match, switch_parent, rev, seqno, write, opts) |
1562 repo, ctx, match, switch_parent, rev, seqno, write, opts) |
1563 if fo is not None: |
1563 if fo is not None: |
1564 fo.close() |
1564 fo.close() |
1565 |
1565 |
1566 def _maybebytestr(v): |
|
1567 if isinstance(v, bytes): |
|
1568 return pycompat.bytestr(v) |
|
1569 return v |
|
1570 |
|
1571 def showmarker(fm, marker, index=None): |
1566 def showmarker(fm, marker, index=None): |
1572 """utility function to display obsolescence marker in a readable way |
1567 """utility function to display obsolescence marker in a readable way |
1573 |
1568 |
1574 To be used by debug function.""" |
1569 To be used by debug function.""" |
1575 if index is not None: |
1570 if index is not None: |
1584 fm.write('parentnodes', '{%s} ', |
1579 fm.write('parentnodes', '{%s} ', |
1585 fm.formatlist(map(hex, parents), name='node', sep=', ')) |
1580 fm.formatlist(map(hex, parents), name='node', sep=', ')) |
1586 fm.write('date', '(%s) ', fm.formatdate(marker.date())) |
1581 fm.write('date', '(%s) ', fm.formatdate(marker.date())) |
1587 meta = marker.metadata().copy() |
1582 meta = marker.metadata().copy() |
1588 meta.pop('date', None) |
1583 meta.pop('date', None) |
1589 smeta = util.rapply(_maybebytestr, meta) |
1584 smeta = util.rapply(pycompat.maybebytestr, meta) |
1590 fm.write('metadata', '{%s}', fm.formatdict(smeta, fmt='%r: %r', sep=', ')) |
1585 fm.write('metadata', '{%s}', fm.formatdict(smeta, fmt='%r: %r', sep=', ')) |
1591 fm.plain('\n') |
1586 fm.plain('\n') |
1592 |
1587 |
1593 def finddate(ui, repo, date): |
1588 def finddate(ui, repo, date): |
1594 """Find the tipmost changeset that matches the given date spec""" |
1589 """Find the tipmost changeset that matches the given date spec""" |