should show a message when pushing(overwriting?) tags

Bug #164450 reported by Martin Pool
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
High
Jelmer Vernooij

Bug Description

bzr push
bzr tag FOO
bzr push
Using saved location: sftp://<email address hidden>/somewhere/
No new revisions to push.

Thankfully it does seem to push the new tag, but the message that it
displays leads me to believe that it actually didn't. It might be
useful to provide feedback when tags are pushed (or maybe even pulled).

Warren Togami

Related branches

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :
Revision history for this message
Parth Malwankar (parthm) wrote :

Hello,

This would be a useful feature to have. I was about to file a new bug
when I read about this. I feel this applies to push as well as pull.

Below is the report I had already composed to be for filing as a bug:

While pushing/pulling tags bzr gives no indication
of it.

I applied tags to a local branch and pushed it to
our server using sftp. I get the "No revisions to push"
message. So I was not sure if the tags were pushed.

So for another branch I needed to tag I applied tags
directly to the repo on the server so that the tags can be
seen by everyone. On doing a pull locally I see the
"No revisions to pull" message but the tags command
shows that tags have been pulled.

[acpstable]% bzr pull
Using saved parent location: sftp://<email address hidden>/home/user0/repo/acpstable/
No revisions to pull
[acpstable]% bzr tags
v0.90.0 1455
[acpstable]%

It seems bzr is doing the right thing but as the user
does not get an indication of it its can be confusing.

It would be good if bzr can show some indication that
even though revisions are not pulled some meta data.
"Metadata updated", "Tags updated" or something.

Revision history for this message
Christian Faulhammer (fauli) wrote :

This behaviour of silently pushing tags lead to some confusion on the Emacs development list...so please add some little display.

Revision history for this message
Parth Malwankar (parthm) wrote :
Download full text (3.2 KiB)

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?

[bzrlib]% bzr cdiff -r -3
=== 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 @@
             target.update_revisions(self, stop_revision,
                 overwrite=overwrite, graph=graph)
         if self._push_should_merge_tags():
- result.tag_conflicts = self.tags.merge_to(target.tags,
+ result.tag_conflicts, result.copied_tag_count = self.tags.merge_to(target.tags,
                 overwrite)
         result.new_revno, result.new_revid = target.last_revision_info()
         return result
@@ -2831,6 +2831,10 @@
             note('No new revisions to push.')
         else:
             note('Pushed up to revision %d.' % self.new_revno)
+ if self.copied_tag_count == 0:
+ note('No tags to push.')
+ else:
+ note('Pushed %d tags.' % self.copied_tag_count)
         self._show_tag_conficts(to_file)

=== modified file 'bzrlib/tag.py'
--- bzrlib/tag.py 2009-06-10 03:56:49 +0000
+++ bzrlib/tag.py 2010-02-20 03:44:48 +0000
@@ -208,13 +208,13 @@
         to_tags.branch.lock_write()
         try:
             dest_dict = to_tags.get_tag_dict()
- result, conflicts = self._reconcile_tags(source_dict, dest_dict,
- overwrite)
+ result, conflicts, copied_tag_count = self._reconcile_tags(source_dict,
+ dest_dict, overwrite)
             if result != dest_dict:
                 to_tags._set_tag_dict(result)
         finally:
             to_tags.branch.unlock()
- return conflicts
+ return conflicts, copied_tag_count

     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, co...

Read more...

Changed in bzr:
assignee: nobody → Parth Malwankar (parthm)
status: Confirmed → In Progress
Parth Malwankar (parthm)
Changed in bzr:
status: In Progress → Confirmed
assignee: Parth Malwankar (parthm) → nobody
Jelmer Vernooij (jelmer)
tags: added: pull push tags
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Setting to high, this can be very confusing.

Changed in bzr:
importance: Low → High
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → In Progress
Jelmer Vernooij (jelmer)
Changed in bzr:
status: In Progress → Fix Released
milestone: none → 2.5b1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions