push --overwrite support

Bug #118787 reported by Sabin Iacob
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

while trying to get over the "no common ancestor" problem that keeps preventing me to push to svn while preserving the branch history, I tried bzr push --overwrite, and got:

bzr: ERROR: exceptions.NotImplementedError: <bound method SvnBranch.set_revision_history of SvnBranch('http://svn.wp-plugins.org/inline-gallery/tags/0.3.8')>

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 718, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 679, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 375, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 820, in run
    push_result = br_from.push(br_to, overwrite)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1542, in push
    _override_hook_source_branch=_override_hook_source_branch)
  File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1584, in _push_with_bound_branches
    result = self._basic_push(target, overwrite, stop_revision)
  File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1608, in _basic_push
    target.set_revision_history(self.revision_history())
  File "/home/iacobs/.bazaar/plugins/svn/branch.py", line 152, in set_revision_history
    raise NotImplementedError(self.set_revision_history)
NotImplementedError: <bound method SvnBranch.set_revision_history of SvnBranch('http://svn.wp-plugins.org/inline-gallery/tags/0.3.8')>

bzr 0.17.0dev0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'push', '--overwrite', 'http://svn.wp-plugins.org/inline-gallery/tags/0.3.8']

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 118787] NotImplementedError raised for SvnBranch.set_revision_history

  status confirmed
  importance wishlist
  summary "push --overwrite support"

Thanks for the bug report.

On Tue, 2007-06-05 at 15:01 +0000, Sabin Iacob wrote:
> Public bug reported:
>
> while trying to get over the "no common ancestor" problem that keeps
> preventing me to push to svn while preserving the branch history, I
> tried bzr push --overwrite, and got:
What version of bzr-svn are you using? If your original branch was
created using the 0.3 series and you are now using 0.4, that might give
errors about no common ancestors.

> bzr: ERROR: exceptions.NotImplementedError: <bound method
> SvnBranch.set_revision_history of SvnBranch('http://svn.wp-plugins.org
> /inline-gallery/tags/0.3.8')>
>
> Traceback (most recent call last):
> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 718, in run_bzr_catch_errors
> return run_bzr(argv)
> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 679, in run_bzr
> ret = run(*run_argv)
> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 375, in run_argv_aliases
> return self.run(**all_cmd_args)
> File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 820, in run
> push_result = br_from.push(br_to, overwrite)
> File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 127, in read_locked
> return unbound(self, *args, **kwargs)
> File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1542, in push
> _override_hook_source_branch=_override_hook_source_branch)
> File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1584, in _push_with_bound_branches
> result = self._basic_push(target, overwrite, stop_revision)
> File "/usr/lib/python2.4/site-packages/bzrlib/branch.py", line 1608, in _basic_push
> target.set_revision_history(self.revision_history())
> File "/home/iacobs/.bazaar/plugins/svn/branch.py", line 152, in set_revision_history
> raise NotImplementedError(self.set_revision_history)
> NotImplementedError: <bound method SvnBranch.set_revision_history of SvnBranch('http://svn.wp-plugins.org/inline-gallery/tags/0.3.8')>
>
> bzr 0.17.0dev0 on python 2.4.4.final.0 (linux2)
> arguments: ['/usr/bin/bzr', 'push', '--overwrite', 'http://svn.wp-plugins.org/inline-gallery/tags/0.3.8']

push --overwrite will be pretty hard to support. Among other things,
this would first require Bazaar core to not use set_revision_history()
but set_last_revision_info().

CHeers,

Jelmer

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/

Changed in bzr-svn:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Confirmed → Triaged
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → jelmer
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 0.4.5
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: 0.4.5 → 0.4.12
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: 0.4.12 → 0.4.11
status: Triaged → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
Revision history for this message
Danny Navarro (jdnavarro) wrote :
Download full text (3.4 KiB)

I'm trying to bzr push --overwrite in subversion repository but I get this error:

$ bzr push --overwrite https://trac.nbic.nl/svn/mzcms/trunk ─┘
bzr: ERROR: subvertpy.SubversionException: ("File or directory '.' is out of date; try updating", 160024)

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/builtins.py", line 1146, in run
    use_existing_dir=use_existing_dir)
  File "/usr/lib/python2.6/site-packages/bzrlib/push.py", line 141, in _show_push_branch
    remember, create_prefix)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/remote.py", line 250, in push_branch
    overwrite=overwrite)
  File "/usr/lib/python2.6/site-packages/bzrlib/branch.py", line 971, in push
    *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 1012, in push
    override_svn_revprops=_override_svn_revprops)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 922, in _update_revisions
    push_merged, overwrite=overwrite)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/push.py", line 217, in push_branch
    overwrite=overwrite)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/push.py", line 239, in push
    override_svn_revprops=target_config.get_override_svn_revprops())
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/push.py", line 153, in push_revision_tree
    revid = builder.commit(rev.message)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/errors.py", line 143, in convert
    raise convert_error(e)
SubversionException: ("File or directory '.' is out of date; try updating", 160024)

bzr 2.1.2 on python 2.6.5 (Linux-2.6.34-ARCH-x86_64-Intel-R-_Xeon-TM-_CPU_3.00GHz-with-glibc2.2.5)
arguments: ['/usr/bin/bzr', 'push', '--overwrite', 'https://trac.nbic.nl/svn/mzcms/trunk']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  launchpad /usr/lib/python2.6/site-packages/bzrlib/plugins/launchpad [2.1.2]
  netrc_credential_store /usr/lib/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.1.2]
  news_merge /usr/lib/python2.6/site-packages/bzrlib/plugins/news_merge [2.1.2]
  rewrite /usr/lib/python2.6/site-packages/bzrlib/plugins/rewrite [0.6.1]
  svn /usr/lib/python2.6/site-packages/bzrlib/plugins...

Read more...

Revision history for this message
Danny Navarro (jdnavarro) wrote :

I fixed with bzr svn-import and later rebasing.

It would be nice to have a more informative error message, though.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 118787] Re: push --overwrite support

  status triaged
  importance low

Hoi Danny,

On Thu, 2010-08-12 at 14:50 +0000, Danny Navarro wrote:
> I fixed with bzr svn-import and later rebasing.
>
> It would be nice to have a more informative error message, though.
Unfortunately this looks like a real bug. While rebasing is a good
workaround, --overwrite should just work.

Is the repository on which you encountered this error public?

Cheers,

Jelmer

Changed in bzr-svn:
importance: Wishlist → Low
status: Fix Released → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

If you would still like to see this bug fixed, please open a new bug report. The bug you have encountered is different from this one.

Changed in bzr-svn:
status: Triaged → Fix Released
Revision history for this message
Gerard Murphy (g-j-murphy) wrote :

Is bug #658395 related to the last part of this discussion before this comment?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.