{"issue":{"created_at":"2011-12-09T18:05:37Z","state":"open","updated_at":"2011-12-09T18:09:42Z","comments":2,"user":{"gravatar_id":"0ea0b53aba2fd846b01e95649a42ec72","id":241791,"url":"https://api.github.com/users/redtoad","avatar_url":"https://secure.gravatar.com/avatar/0ea0b53aba2fd846b01e95649a42ec72?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"redtoad"},"body":"I kept getting the error \"Error getting tags: too many values to unpack\" and managed to dig up this traceback:\r\n\r\n    Traceback (most recent call last):\r\n      File \"/var/www/readthedocs.org/readthedocs/projects/tasks.py\", line 197, in update_imported_docs\r\n        branches = version_repo.branches\r\n      File \"/var/www/readthedocs.org/readthedocs/vcs_support/backends/hg.py\", line 48, in branches\r\n        return self.parse_branches(stdout)\r\n      File \"/var/www/readthedocs.org/readthedocs/vcs_support/backends/hg.py\", line 62, in parse_branches\r\n        name, rev = branch\r\n    ValueError: too many values to unpack\r\n\r\nApparently, my repo had these branches\r\n\r\n    default                      849:977050cb8c00\r\n    live                         844:850bf39e854e\r\n    django-1.3                   824:bad905aa8f09\r\n    shop                         735:f463e31201a0 (inactive)\r\n\r\nand trying to splitting the `shop` branch resulted in `['shop', '735:f463e31201a0', '(inactive)']` to be used. Which doesn't work of course.\r\n\r\n","assignee":null,"id":2504681,"number":147,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"update_repos breaks if mercurial repo has inactive branches","html_url":"https://github.com/rtfd/readthedocs.org/issues/147","closed_at":null,"url":"https://api.github.com/repos/rtfd/readthedocs.org/issues/147","milestone":null},"action":"created","comment":{"created_at":"2011-12-09T18:09:42Z","updated_at":"2011-12-09T18:09:42Z","user":{"gravatar_id":"0ea0b53aba2fd846b01e95649a42ec72","id":241791,"url":"https://api.github.com/users/redtoad","avatar_url":"https://secure.gravatar.com/avatar/0ea0b53aba2fd846b01e95649a42ec72?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"redtoad"},"body":"Solution 2\r\n-----------------\r\n\r\nRestrict returned splitted values\r\n\r\n\r\n    diff --git a/readthedocs/vcs_support/backends/hg.py b/readthedocs/vcs_support/backends/hg.py\r\n    index 3adf7fd..18f1169 100644\r\n    --- a/readthedocs/vcs_support/backends/hg.py\r\n    +++ b/readthedocs/vcs_support/backends/hg.py\r\n    @@ -58,7 +59,7 @@ class Backend(BaseVCS):\r\n                 branch = filter(lambda f: f != '', branch)\r\n                 if branch == []:\r\n                     continue\r\n    -            name, rev = branch\r\n    +            name, rev = branch[:2]\r\n                 clean_branches.append(VCSVersion(self, name, name))\r\n             return clean_branches\r\n","id":3083326,"url":"https://api.github.com/repos/rtfd/readthedocs.org/issues/comments/3083326"}}