Mercurial > python-hglib
comparison 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 |
comparison
equal
deleted
inserted
replaced
94:4da6bb8abfcc | 95:bd23bc72e662 |
---|---|
1 import subprocess, os, struct, cStringIO, re | 1 import subprocess, os, struct, cStringIO, re |
2 import hglib, error, util, templates, merge | 2 import hglib, error, util, templates, merge, context |
3 | 3 |
4 from util import cmdbuilder | 4 from util import cmdbuilder |
5 | 5 |
6 class revision(tuple): | 6 class revision(tuple): |
7 def __new__(cls, rev, node, tags, branch, author, desc): | 7 def __new__(cls, rev, node, tags, branch, author, desc): |
1518 v[i] = 0 | 1518 v[i] = 0 |
1519 | 1519 |
1520 self._version = tuple(v) | 1520 self._version = tuple(v) |
1521 | 1521 |
1522 return self._version | 1522 return self._version |
1523 | |
1524 def __getitem__(self, changeid): | |
1525 return context.changectx(self, changeid) |