# HG changeset patch # User Idan Kamara # Date 1311450939 -10800 # Node ID 96f8c5095e2ec11dcf13184568e31087ef6ef037 # Parent 3182303f388d88f85fb75a13e85cca45198cc955 client: use --template instead of --style for cset display diff -r 3182303f388d -r 96f8c5095e2e hglib/client.py --- a/hglib/client.py Tue Aug 09 00:39:27 2011 +0300 +++ b/hglib/client.py Sat Jul 23 22:55:39 2011 +0300 @@ -1,5 +1,5 @@ import subprocess, os, struct, cStringIO, collections -import hglib, error, util +import hglib, error, util, templates from util import cmdbuilder @@ -9,10 +9,6 @@ outputfmtsize = struct.calcsize(outputfmt) retfmt = '>i' - # XXX fix this hack - _stylesdir = os.path.join(os.path.dirname(__file__), 'styles') - revstyle = os.path.join(_stylesdir, 'rev.style') - revision = collections.namedtuple('revision', 'rev, node, tags, ' 'branch, author, desc') @@ -190,7 +186,7 @@ return d def log(self, revrange=None): - args = cmdbuilder('log', style=hgclient.revstyle, rev=revrange) + args = cmdbuilder('log', template=templates.changeset, rev=revrange) out = self.rawcommand(args) out = out.split('\0')[:-1] @@ -200,7 +196,7 @@ def incoming(self, revrange=None, path=None): args = cmdbuilder('incoming', path, - style=hgclient.revstyle, rev=revrange) + template=templates.changeset, rev=revrange) def eh(ret, out, err): if ret != 1: @@ -215,7 +211,7 @@ def outgoing(self, revrange=None, path=None): args = cmdbuilder('outgoing', - path, style=hgclient.revstyle, rev=revrange) + path, template=templates.changeset, rev=revrange) def eh(ret, out, err): if ret != 1: @@ -264,7 +260,7 @@ self.rawcommand(args) def tip(self): - args = cmdbuilder('tip', style=hgclient.revstyle) + args = cmdbuilder('tip', template=templates.changeset) out = self.rawcommand(args) out = out.split('\0') diff -r 3182303f388d -r 96f8c5095e2e hglib/styles/rev.style --- a/hglib/styles/rev.style Tue Aug 09 00:39:27 2011 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -changeset = '{rev}\0{node}\0{tags}\0{branch}\0{author}\0{desc}\0' diff -r 3182303f388d -r 96f8c5095e2e hglib/templates.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hglib/templates.py Sat Jul 23 22:55:39 2011 +0300 @@ -0,0 +1,1 @@ +changeset = '{rev}\\0{node}\\0{tags}\\0{branch}\\0{author}\\0{desc}\\0'