Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Some fixes to be able to push --overwrite after amending a commit #44

Merged
merged 3 commits into from

2 participants

@em-

No description provided.

em- added some commits
@em- em- Don't fail when deleting a missing bzr/master reference
It is possible to interrupt a sync operation after the bzr/master
reference has been cancelled and before it has been re-created:
we can simply ignore errors when trying to delete it.
a8f282c
@em- em- Don't sync if we're going to do an overwriting push
This make possible to do an push --overwrite after amending a
commit.
d06da4a
@em- em- Log command invocations with loglevel=INFO
Leave loglevel=DEBUG for very verbose things like the fast-import
output data.
9701060
@termie termie merged commit ae6a083 into termie:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 22, 2012
  1. @em-

    Don't fail when deleting a missing bzr/master reference

    em- authored
    It is possible to interrupt a sync operation after the bzr/master
    reference has been cancelled and before it has been re-created:
    we can simply ignore errors when trying to delete it.
  2. @em-

    Don't sync if we're going to do an overwriting push

    em- authored
    This make possible to do an push --overwrite after amending a
    commit.
  3. @em-

    Log command invocations with loglevel=INFO

    em- authored
    Leave loglevel=DEBUG for very verbose things like the fast-import
    output data.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 git-bzr
View
6 git-bzr
@@ -30,7 +30,7 @@ def run_command(cmd, error_ok=False, error_message=None, exit_code=False,
redirect_stdout=True, return_proc=False, stdout=None,
stdin=None):
# Useful for debugging:
- logging.debug(' '.join(cmd))
+ logging.info(' '.join(cmd))
if redirect_stdout and stdout is None:
stdout = subprocess.PIPE
@@ -257,7 +257,7 @@ def export_bzr(bzr_ref, cl=None, overwrite=False):
bzr_import_arg = git_import_arg = []
if overwrite:
- git(['branch', '-D', bzr_ref])
+ git(['branch', '-D', bzr_ref], error_ok=True)
# NOTE(termie): this happens in reverse because we're piping
git_proc = git(['fast-import'] + git_import_arg + [
@@ -455,7 +455,7 @@ def cmd_push(args):
else:
known_upstream = None
- if known_upstream and (not upstream or upstream == known_upstream):
+ if not options.overwrite and known_upstream and (not upstream or upstream == known_upstream):
upstream = known_upstream
# Sync first
Something went wrong with that request. Please try again.