diff hglib/client.py @ 95:bd23bc72e662

client: add a convenience method __getitem__ to return a changectx
author Idan Kamara <idankk86@gmail.com>
date Thu, 22 Dec 2011 19:12:47 +0200
parents 0383fc37102b
children 9746227239e0
line wrap: on
line diff
--- a/hglib/client.py	Thu Dec 22 19:12:47 2011 +0200
+++ b/hglib/client.py	Thu Dec 22 19:12:47 2011 +0200
@@ -1,5 +1,5 @@
 import subprocess, os, struct, cStringIO, re
-import hglib, error, util, templates, merge
+import hglib, error, util, templates, merge, context
 
 from util import cmdbuilder
 
@@ -1520,3 +1520,6 @@
             self._version = tuple(v)
 
         return self._version
+
+    def __getitem__(self, changeid):
+        return context.changectx(self, changeid)