[issue3097] hglib dies on branches with spaces in them

Paul Nathan bugs at mercurial.selenic.com
Wed Nov 9 15:46:19 CST 2011


New submission from Paul Nathan <paul_nathan at selinc.com>:

Hi,

In the case when someone creates a branch with spaces, hg_lib will raise an 
exception when queried with branches().

hglib version: 4282391dd693
Mercurial 2.0 from Ubuntu PPA.


Log of error:

paulnath at paulnathlinux:~/temp/horrible_repo$ hg branches
thing with spaces             11:0ce6346113e5
default                       10:45523216fb76
branchtastic                   7:b0f545d42277
paulnath at paulnathlinux:~/temp/horrible_repo$ ipython
Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import hglib

In [2]: c = hglib.open(".")

In [3]: c.branches()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/paulnath/temp/horrible_repo/<ipython console> in <module>()

/usr/local/lib/python2.7/dist-packages/hglib/client.pyc in branches(self, 
active, closed)
    385             rev, node = line.split(':')
    386             node = node.split()[0] # get rid of ' (inactive)'
--> 387             branches.append((name, int(rev), node))
    388         return branches
    389 

ValueError: invalid literal for int() with base 10: 'with spaces             
11'

In [4]:

----------
messages: 18014
nosy: paulnath
priority: bug
status: unread
title: hglib dies on branches with spaces in them

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3097>
____________________________________________________


More information about the Mercurial-devel mailing list