Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Install using pip:

python tagz.py -r mozilla/fireplace -c create -t 2014.02.11

* To create a tag from a particular revision:

python tagz.py -r mozilla/fireplace -c create -t 2014.02.11 -s 2014.02.07

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More doc on when this is useful?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example?


* To create multiple tags:

python tagz.py -r mozilla/monolith,mozilla/solitude,mozilla/webpay,mozilla/commbadge,mozilla/fireplace,mozilla/marketplace-stats,mozilla/monolith-aggregator,mozilla/rocketfuel,mozilla/zamboni -c create -t 2014.02.11
Expand Down
15 changes: 13 additions & 2 deletions tagz.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

$ python tagz.py -r mozilla/fireplace -c create -t 2014.02.11

* To create a tag from a particular revision:

$ python tagz.py -r mozilla/fireplace -c create -t 2014.02.11 -s 2014.02.07

* To create multiple tags:

$ python tagz.py -r mozilla/fireplace,mozilla/zamboni -c create -t 2014.02.11
Expand Down Expand Up @@ -175,7 +179,8 @@ def main():

if cmd in ('cherrypick', 'revert') and not sha:
p.error(
'argument -s/--sha is required is when cherry-picking a commit')
'argument -s/--sha is required is when cherry-picking/reverting '
'a commit')

repos = [get_remote_url(x.strip()) for x in repo.split(',')]
urls = []
Expand All @@ -184,14 +189,20 @@ def main():
path = get_git_path(remote_url)
team, repo = get_team_repo(remote_url).split('/')

# Use default branch (most likely `master`) when creating a new tag.
default_sha = git(path, 'rev-parse origin/HEAD')

# Check out master.
git(path, 'checkout master')
git(path, 'checkout %s' % default_sha)

# Fetch the latest tags and code.
git(path, 'fetch --tags')
git(path, 'pull --rebase')

if cmd == 'create':
# Check out a particular revision.
git(path, 'checkout %s' % default_sha)

git_create_tag(path, tag)

elif cmd == 'cherrypick':
Expand Down