Are revlog diff calculated as "text" ALWAYS?

Kastner Masilko, Friedrich kastner-masilko at at.festo.com
Tue May 13 18:03:48 UTC 2014


> From: Scott Palmer [mailto:swpalmer at gmail.com]
>
> Since Mercurial *always* uses a binary diff, the observed phenomenon
> must be something else.  E.g. a full snapshot is being stored for some
> reason instead of a diff.

I've checked the mdiff.textdiff (is just the bdiff.bdiff implementation) directly via a small extension[1]. And it really shows a very inefficient diffing of the "one-liner": the delta is as long as the file itself. Skimming through the C-implementation there, it looks like the line-ending "chunking" is intended behavior. Any thoughts on how to improve on that?

regards,
Fritz

[1]:
from mercurial import commands, mdiff, scmutil, cmdutil
from mercurial.i18n import _
cmdtable = {}
command = cmdutil.command(cmdtable)
@command('^debugdiff',
         [('r', 'rev', [], _('revision'), _('REV')),
         ],
         _('hg debugdiff [-r REV] [FILE]'))
def debugdiff(ui, repo, fn=None, **opts):
    r1, r2 = scmutil.revpair(repo, opts.get('rev'))

    if fn is None: return

    fp = cmdutil.makefileobj(repo, '')
    fp.write(mdiff.textdiff(repo[r1][fn].data(),repo[r2][fn].data()))
    fp.close()




Development Software Systems
Festo Gesellschaft m.b.H.
Linzer Strasse 227
Austria - 1140 Wien

Firmenbuch Wien
FN 38435y
UID: ATU14650108

Tel: +43(1)91075-198
Fax: 
www.festo.at

Der Inhalt dieser E-Mail und moeglicher Anhaenge sind ausschliesslich fuer den bezeichneten Adressaten bestimmt.
Jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail und
moeglicher Anhaenge durch unberechtigte Dritte ist unzulaessig. Wir bitten Sie, sich mit dem Absender der E-Mail in
Verbindung zu setzen, falls Sie nicht der Adressat dieser E-Mail sind sowie das Material von Ihrem Computer zu loeschen.

This e-mail and any attachments are confidential and intended solely for the addressee. The perusal, publication, copying or
dissemination of the contents of this e-mail by unauthorised third parties is prohibited. If you are not the intended recipient of this
e-mail, please delete it and immediately notify the sender.



More information about the Mercurial mailing list