Skip to content

Commit

Permalink
Prevent pushing a new root by default
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Jan 4, 2016
1 parent 9015f2e commit dc91e13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cinnabar/hg.py
Expand Up @@ -323,9 +323,16 @@ def revs():

pushed = False
if push_commits:
has_root = any(len(p) == 40 for p in push_commits)
force = all(v[1] for v in what.values())
if has_root and repo_heads:
if not force:
raise Exception('Cannot push a new root')
else:
logging.warn('Pushing a new root')
chunks = util.chunkbuffer(create_bundle(store, push_commits))
cg = cg1unpacker(chunks, 'UN')
if all(v[1] for v in what.values()):
if force:
repo_heads = ['force']
else:
if not repo_heads:
Expand Down

0 comments on commit dc91e13

Please sign in to comment.