'Populate or unpopulate the toolshed and changeset_revision attributes of a
<repository> tag.  Populating will occur when a dependency definition file
is being uploaded to the repository, while unpopulating will occur when the
repository is being exported.'

def handle_tag_attributes(self, config):

    (tree, error_message) = xml_util.parse_xml(config)
    if (tree is None):
        return (False, None, error_message)
    root = tree.getroot()
    root_altered = False
    new_root = copy.deepcopy(root)
    for (index, elem) in enumerate(root):
        if (elem.tag == 'repository'):
            (altered, new_elem, error_message) = self.handle_elem(elem)
            if error_message:
                error_message = ('The    %s    file    contains    an    invalid    <repository>    tag.        %s' % (self.file_name, error_message))
                return (False, None, error_message)
            if altered:
                if (not root_altered):
                    root_altered = True
                new_root[index] = new_elem
    return (root_altered, new_root, error_message)
