Merge lp:~maxb/bzr-fastimport/tag-on-fi-commit-to-tag-ref into lp:~bzr/bzr-fastimport/fastimport.dev

Proposed by Max Bowsher
Status: Merged
Approved by: Ian Clatworthy
Approved revision: 261
Merged at revision: not available
Proposed branch: lp:~maxb/bzr-fastimport/tag-on-fi-commit-to-tag-ref
Merge into: lp:~bzr/bzr-fastimport/fastimport.dev
Diff against target: 24 lines
1 file modified
processors/generic_processor.py (+7/-0)
To merge this branch: bzr merge lp:~maxb/bzr-fastimport/tag-on-fi-commit-to-tag-ref
Reviewer Review Type Date Requested Status
Bazaar Developers Pending
Review via email: mp+14449@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Max Bowsher (maxb) wrote :

A tag in git is simply a ref in the refs/tags/* namespace. They are *usually* created with a reset command, but this is *not always* the case. It is legal to use a commit command to create a tag. This merge changes bzr-fastimport to pay attention to tags created by the commit command, as well as tags created by the reset command.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'processors/generic_processor.py'
2--- processors/generic_processor.py 2009-10-21 22:08:48 +0000
3+++ processors/generic_processor.py 2009-11-05 00:25:20 +0000
4@@ -474,6 +474,9 @@
5 pass
6 self.cache_mgr._blobs = {}
7 self._revision_count += 1
8+ if cmd.ref.startswith('refs/tags/'):
9+ tag_name = cmd.ref[len('refs/tags/'):]
10+ self._set_tag(tag_name, cmd.id)
11 return
12 if self.first_incremental_commit:
13 self.first_incremental_commit = None
14@@ -492,6 +495,10 @@
15 self._revision_count += 1
16 self.report_progress("(%s)" % cmd.id)
17
18+ if cmd.ref.startswith('refs/tags/'):
19+ tag_name = cmd.ref[len('refs/tags/'):]
20+ self._set_tag(tag_name, cmd.id)
21+
22 # Check if we should finish up or automatically checkpoint
23 if (self.max_commits is not None and
24 self._revision_count >= self.max_commits):

Subscribers

People subscribed via source and target branches

to all changes: