[Bug 4196] New: repo passed in to hook seems to be a random enabled extension name + repo i.e. 'eolrepo'

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Mar 17 04:46:29 CDT 2014


http://bz.selenic.com/show_bug.cgi?id=4196

          Priority: normal
            Bug ID: 4196
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: repo passed in to hook seems to be a random enabled
                    extension name + repo i.e. 'eolrepo'
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: snaish at gmail.com
          Hardware: All
            Status: UNCONFIRMED
           Version: 2.9.1
         Component: Mercurial
           Product: Mercurial

Running a hook to check single head per branch on a set of changes passed into
a repository.

Code is:-

        self.ui.write('Checking for single head per branch in changegroup\n')
        branches_good = True

        for branch in self.repo.branchtags():
            heads = self.repo.branchheads(branch)
            self.ui.debug('Branch: {0}\n'.format(branch))
            if len(heads) > 1:
                self.ui.warn('Multiple heads found on branch: {0}\nOnly one
head allowed per branch\n'.format(branch))
                branches_good = False

        return branches_good



Fails with the following error:-

AttributeError: 'eolrepo' object has no attribute 'branchtags'

On invesitation the 'eolrepo' is a reference to the eol extension, proved as if
that extension is disabled the hook fails stating that the next ectension in
the enabled extensions has no attribute 'branchtags'

This bug is not in 2.8.2, where the Hook attribute self.repo (which is assigned
the repo passed into the hook) is the repository instance, and
self.repo.branchtags() works as intended.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list