I decided to hack this a bit. I have the following working.
[foo]% bzr tag abc0
Created tag abc0.
[foo]% ~/src/bzr.dev/164450-push-pull-tags/bzr --no-plugins push ../bar
No new revisions to push.
Pushed 1 tags.
[foo]% ~/src/bzr.dev/164450-push-pull-tags/bzr --no-plugins push ../bar
No new revisions to push.
No tags to push.
[foo]%
.. but I am not too familiar with the way push/pull works, so I would
appreciate any help in understanding the existing design.
This is what I put together (push only right now). Updated methods are
branch.BzrBranch._basic_push, branch.BranchPushResult.report, and
tag.BasicTags._reconcile_tags.
Does this approach seem reasonable?
Would a similar approach apply to pull?
def rename_revisions(self, rename_map):
"""Rename revisions in this tags dictionary.
@@ -241,14 +241,18 @@
"""
conflicts = []
result = dict(dest_dict) # copy
+ copied_tag_count = 0
for name, target in source_dict.items():
- if name not in result or overwrite:
+ name_not_in_result = name not in result
+ if name_not_in_result:
+ copied_tag_count += 1
+ if name_not_in_result or overwrite: result[name] = target
elif result[name] == target: pass
else: conflicts.append((name, target, result[name]))
- return result, conflicts
+ return result, conflicts, copied_tag_count
I decided to hack this a bit. I have the following working.
[foo]% bzr tag abc0 dev/164450- push-pull- tags/bzr --no-plugins push ../bar dev/164450- push-pull- tags/bzr --no-plugins push ../bar
Created tag abc0.
[foo]% ~/src/bzr.
No new revisions to push.
Pushed 1 tags.
[foo]% ~/src/bzr.
No new revisions to push.
No tags to push.
[foo]%
.. but I am not too familiar with the way push/pull works, so I would
appreciate any help in understanding the existing design.
This is what I put together (push only right now). Updated methods are BzrBranch. _basic_ push, branch. BranchPushResul t.report, and _reconcile_ tags.
branch.
tag.BasicTags.
Does this approach seem reasonable?
Would a similar approach apply to pull?
[bzrlib]% bzr cdiff -r -3
target. update_ revisions( self, stop_revision,
overwrite= overwrite, graph=graph) should_ merge_tags( ): tag_conflicts = self.tags. merge_to( target. tags, tag_conflicts, result. copied_ tag_count = self.tags. merge_to( target. tags,
overwrite)
result. new_revno, result.new_revid = target. last_revision_ info()
note( 'No new revisions to push.')
note( 'Pushed up to revision %d.' % self.new_revno) tag_count == 0: tag_count)
self. _show_tag_ conficts( to_file)
=== modified file 'bzrlib/branch.py'
--- bzrlib/branch.py 2010-01-12 02:48:41 +0000
+++ bzrlib/branch.py 2010-02-20 04:23:23 +0000
@@ -2328,7 +2328,7 @@
if self._push_
- result.
+ result.
return result
@@ -2831,6 +2831,10 @@
else:
+ if self.copied_
+ note('No tags to push.')
+ else:
+ note('Pushed %d tags.' % self.copied_
=== modified file 'bzrlib/tag.py'
to_tags. branch. lock_write( )
dest_ dict = to_tags. get_tag_ dict() _tags(source_ dict, dest_dict, _tags(source_ dict,
to_tags. _set_tag_ dict(result)
to_ tags.branch. unlock( )
--- bzrlib/tag.py 2009-06-10 03:56:49 +0000
+++ bzrlib/tag.py 2010-02-20 03:44:48 +0000
@@ -208,13 +208,13 @@
try:
- result, conflicts = self._reconcile
- overwrite)
+ result, conflicts, copied_tag_count = self._reconcile
+ dest_dict, overwrite)
if result != dest_dict:
finally:
- return conflicts
+ return conflicts, copied_tag_count
def rename_ revisions( self, rename_map): dict.items( ):
result[ name] = target
pass
conflicts. append( (name, target, result[name]))
"""Rename revisions in this tags dictionary.
@@ -241,14 +241,18 @@
"""
conflicts = []
result = dict(dest_dict) # copy
+ copied_tag_count = 0
for name, target in source_
- if name not in result or overwrite:
+ name_not_in_result = name not in result
+ if name_not_in_result:
+ copied_tag_count += 1
+ if name_not_in_result or overwrite:
elif result[name] == target:
else:
- return result, conflicts
+ return result, conflicts, copied_tag_count
def _merge_ tags_if_ possible( from_branch, to_branch):
[bzrlib]%