changeset 6:96f8c5095e2e

client: use --template instead of --style for cset display
author Idan Kamara <idankk86@gmail.com>
date Sat, 23 Jul 2011 22:55:39 +0300
parents 3182303f388d
children eac8be119d81
files hglib/client.py hglib/styles/rev.style hglib/templates.py
diffstat 3 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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')
 
--- 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'
--- /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'