Add a new tag for a given package hash.

    Unlike versions, tags can have an arbitrary format, and can be modified
    and deleted.

    When a package is pushed, it gets the "latest" tag.
336764
def tag_add(package, tag, pkghash):
    
    team, owner, pkg = parse_package(package)
    session = _get_session(team)

    session.put(
        "{url}/api/tag/{owner}/{pkg}/{tag}".format(
            url=get_registry_url(team),
            owner=owner,
            pkg=pkg,
            tag=tag
        ),
        data=json.dumps(dict(
            hash=_match_hash(package, pkghash)
        ))
    )
160041
def tag_add(self, *tags):
        
        return View({**self.spec, 'tag': list(set(self.tags) | set(tags))})
480696
def _update_repo(repo_config, store, tags_only):
    
    repo_path = store.clone(repo_config['repo'], repo_config['rev'])

    cmd_output('git', 'fetch', cwd=repo_path)
    tag_cmd = ('git', 'describe', 'origin/master', '--tags')
    if tags_only:
        tag_cmd += ('--abbrev=0',)
    else:
        tag_cmd += ('--exact',)
    try:
        rev = cmd_output(*tag_cmd, cwd=repo_path)[1].strip()
    except CalledProcessError:
        tag_cmd = ('git', 'rev-parse', 'origin/master')
        rev = cmd_output(*tag_cmd, cwd=repo_path)[1].strip()

    # Don't bother trying to update if our rev is the same
    if rev == repo_config['rev']:
        return repo_config

    try:
        path = store.clone(repo_config['repo'], rev)
        manifest = load_manifest(os.path.join(path, C.MANIFEST_FILE))
    except InvalidManifestError as e:
        raise RepositoryCannotBeUpdatedError(six.text_type(e))

    # See if any of our hooks were deleted with the new commits
    hooks = {hook['id'] for hook in repo_config['hooks']}
    hooks_missing = hooks - {hook['id'] for hook in manifest}
    if hooks_missing:
        raise RepositoryCannotBeUpdatedError(
            'Cannot update because the tip of master is missing these hooks:\n'
            '{}'.format(', '.join(sorted(hooks_missing))),
        )

    # Construct a new config with the head rev
    new_config = repo_config.copy()
    new_config['rev'] = rev
    return new_config
304813
def add_tag(self, task, params={}, **options): 
        
        path = "/tasks/%s/addTag" % (task)
        return self.client.post(path, params, **options)
279994
def new_tag(self, label, cfrom=-1, cto=-1, tagtype='', **kwargs):
        '''  '''
        tag_obj = Tag(label, cfrom, cto, tagtype=tagtype, **kwargs)
        return self.add_tag(tag_obj)
990287
def add_tags(self, *tags):
        
        for _tag in tags:
            self.tags.get_or_create(name=_tag)
71156
def tag(message):
    # type: () -> None
    
    release_ver = versioning.current()
    message = message or 'v{} release'.format(release_ver)

    with conf.within_proj_dir():
        log.info("Creating release tag")
        git.tag(
            author=git.latest_commit().author,
            name='v{}'.format(release_ver),
            message=message,
        )
891962
def add_to_package_file(self, root, srcfile, node_path, target, source_path, transform, custom_meta):
        
        filehash = self.save_file(srcfile)
        metahash = self.save_metadata(custom_meta)
        self._add_to_package_contents(root, node_path, [filehash], target, source_path, transform, metahash)
165118
function add_shared(hash, customTags, doc_map) {
    hash = utils.merge(hash, {
      "inheritable" : !!doc_map["inheritable"],
      "inheritdoc" : extract(doc_map, "inheritdoc"),
      "related" : extract(doc_map, "related"),
      "see" : extract(doc_map, "see"),
      "private" : extract(doc_map, "private") !== null ? true : false,
      "experimental" : extract(doc_map, "experimental") !== null ? true : false,
      "ignore" : extract(doc_map, "ignore") !== null ? true : false,
      "author" : extract_plural(doc_map["author"] || []),
      "version" : extract(doc_map, "version"),
      "since" : extract(doc_map, "since"),
      "todo" : extract(doc_map, "todo")
    });

    if (customTags !== undefined) {
      var custom = {};
      _.each(customTags, function(tag) {
        var text = extract(doc_map, tag);
        if (text !== null) {
          custom[tag] = text.doc.length > 0 ? text.doc : true;
        }
      });

      hash = utils.merge(hash, custom);
    }

    return hash;
}
420752
def add_tag(self, new_tags):
        

        tags = self.get_tags()
        orig_tag_cnt = len(tags)
        # print("self.get_tags() {}".format(tags))

        if isinstance(new_tags, six.string_types):
            new_tags = new_tags.split(',')
            # print("spliting tags :: {}".format(new_tags))

        for tag in new_tags:
            if not tag in tags:
                tags.append(tag.strip())

        if len(tags) > orig_tag_cnt:
            xml_tags = escape(",".join(tags))
            post_data = TAGS_TEMPLATE.format(connectware_id=self.get_connectware_id(),
                                             tags=xml_tags)
            self._conn.put('/ws/DeviceCore', post_data)

            # Invalidate cache
            self._device_json = None
459240
function createTag() {
  var newTagName = 'v1.0.0';

  return git.tag({tag: newTagName, message: newTagName + ' release', annotated: true})
      .then(git.push.bind(null, {tag: newTagName, remote: remote}));

}
178733
def add_tag(self, resource_type, resource_id, tag, **_params):
        """"""
        return self.put(self.tag_path % (resource_type, resource_id, tag))
1303348
function addAll(packages, packageIndex) {
		
	// iterate over packages and prepare urls before I call the registry
	for (var p in packages) {
		if(p.indexOf('@') === 0) {
			p = p.substring(p.indexOf('/') + 1, p.length)
		}
		var package = p + '@' + packages[p]

		if (packageIndex.indexOf(package) === -1) {
			packageIndex.push(package)
		}
	}	
}
1079881
def _add_to_package_contents(self, pkgroot, node_path, hashes, target,
                                 source_path, transform, user_meta_hash):
        
        assert isinstance(node_path, list)
        assert user_meta_hash is None or isinstance(user_meta_hash, str)

        contents = pkgroot

        if not node_path:
            # Allow setting metadata on the root node, but that's it.
            assert target is TargetType.GROUP
            contents.metadata_hash = user_meta_hash
            return

        ptr = contents
        for node in node_path[:-1]:
            ptr = ptr.children[node]

        if target is TargetType.GROUP:
            node = GroupNode(
                children=dict(),
                metadata_hash=user_meta_hash
            )
        else:
            node = FileNode( # pylint:disable=R0204
                hashes=hashes,
                metadata=dict(
                    q_ext=transform,
                    q_path=source_path,
                    q_target=target.value
                ),
                metadata_hash=user_meta_hash
            )

        ptr.children[node_path[-1]] = node
814090
def add_tag(tag)
      if @counters[:attributes][:tag] >= Mailgun::Chains::MAX_TAGS
        fail Mailgun::ParameterError, 'Too many tags added to message.', tag
      end
      set_multi_complex('o:tag', tag)
      @counters[:attributes][:tag] += 1
    end
726765
def add_package(self, check_name, package):
        
        self._package_set.add(package)
        package_data = self._packages[package.name]
        self._checks_deps[check_name].append(package)

        # Versions
        if package.version:
            versions = package_data['versions']
            versions[package.version].append(check_name)

        # Marker section
        if package.marker:
            markers = package_data['markers']
            markers[package.marker].append(check_name)
209204
def push_git_package(self):
        
        ## check for conflicts, then write to local files
        self._pull_branch_from_origin()

        ## log commits to releasenotes
        if self.deploy:
            self._write_commits_to_release_notes()

        ## writes tag or 'devel' to 
        try:            
            self._write_new_tag_to_init()
            self._write_branch_and_tag_to_meta_yaml()
            self._push_new_tag_to_git()

        except Exception as inst:
            print("\n Error:\n", inst)
            self._revert_tag_in_init()
            sys.exit(2)