diff hglib/util.py @ 8:3ac38d500d68

move hgclient._eatlines to util
author Idan Kamara <idankk86@gmail.com>
date Wed, 10 Aug 2011 01:38:18 +0300
parents d7903b923217
children 5882a698ad5c
line wrap: on
line diff
--- a/hglib/util.py	Sat Jul 23 22:55:39 2011 +0300
+++ b/hglib/util.py	Wed Aug 10 01:38:18 2011 +0300
@@ -5,6 +5,13 @@
     args = [iter(iterable)] * n
     return itertools.izip(*args)
 
+def eatlines(s, n):
+    idx = 0
+    for i in xrange(n):
+        idx = s.find('\n', idx) + 1
+
+    return s[idx:]
+
 def cmdbuilder(name, *args, **kwargs):
     """
     A helper for building the command arguments