Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Aug 22, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions git-bzr
Expand Up @@ -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

Expand Down Expand Up @@ -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 + [
Expand Down Expand Up @@ -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
Expand Down