# HG changeset patch # User Sune Foldager # Date 1283345703 -7200 # Node ID c061f9882ff75e2dd9d2bd31903d3b1e01cd7084 # Parent 48735ce023456f4189cfc9c60f095412e4d9aec5 debugdata: try to access filelogs through repo, if possible If a repository is accesible, first treat the filename as a working copy file and try to open its filelog. Fallback to opening the file directly as a revlog, as before. diff -r 48735ce02345 -r c061f9882ff7 mercurial/commands.py --- a/mercurial/commands.py Wed Sep 01 12:28:34 2010 +0200 +++ b/mercurial/commands.py Wed Sep 01 14:55:03 2010 +0200 @@ -1214,9 +1214,15 @@ ui.write(line) ui.write("\n") -def debugdata(ui, file_, rev): +def debugdata(ui, repo, file_, rev): """dump the contents of a data file revision""" - r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i") + r = None + if repo: + filelog = repo.file(file_) + if len(filelog): + r = filelog + if not r: + r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_[:-2] + ".i") try: ui.write(r.revision(r.lookup(rev))) except KeyError: @@ -4476,7 +4482,8 @@ "version": (version_, []), } -norepo = ("clone init version help debugcommands debugcomplete debugdata" +norepo = ("clone init version help debugcommands debugcomplete" " debugindex debugindexdot debugdate debuginstall debugfsinfo" " debugpushkey") -optionalrepo = ("identify paths serve showconfig debugancestor debugdag") +optionalrepo = ("identify paths serve showconfig debugancestor debugdag" + " debugdata")