Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 11211:e43c23d189a5
push: add --new-branch option to allow intial push of new branches
Compare this to --force which allows anything to be pushed. With --new-branch,
only changesets to named branches not present on the and changesets not
introducing additional heads on existing branches are allowed.
Developed by
Henrik Stuart <henrik.stuart@edlund.dk>
Sune Foldager <cryo@cyanite.org>
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Fri, 21 May 2010 15:22:29 +0200 |
parents | 687c7d395f20 |
children | ffd59c71b8ee |
comparison
equal
deleted
inserted
replaced
11210:0c0088881562 | 11211:e43c23d189a5 |
---|---|
2562 subs = c.substate # only repos that are committed | 2562 subs = c.substate # only repos that are committed |
2563 for s in sorted(subs): | 2563 for s in sorted(subs): |
2564 if not c.sub(s).push(opts.get('force')): | 2564 if not c.sub(s).push(opts.get('force')): |
2565 return False | 2565 return False |
2566 | 2566 |
2567 r = repo.push(other, opts.get('force'), revs=revs) | 2567 r = repo.push(other, opts.get('force'), revs=revs, |
2568 newbranch=opts.get('new_branch')) | |
2568 return r == 0 | 2569 return r == 0 |
2569 | 2570 |
2570 def recover(ui, repo): | 2571 def recover(ui, repo): |
2571 """roll back an interrupted transaction | 2572 """roll back an interrupted transaction |
2572 | 2573 |
3946 [('f', 'force', None, _('force push')), | 3947 [('f', 'force', None, _('force push')), |
3947 ('r', 'rev', [], | 3948 ('r', 'rev', [], |
3948 _('a changeset intended to be included in the destination')), | 3949 _('a changeset intended to be included in the destination')), |
3949 ('b', 'branch', [], | 3950 ('b', 'branch', [], |
3950 _('a specific branch you would like to push')), | 3951 _('a specific branch you would like to push')), |
3952 ('', 'new-branch', False, _('allow pushing a new branch')), | |
3951 ] + remoteopts, | 3953 ] + remoteopts, |
3952 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')), | 3954 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')), |
3953 "recover": (recover, []), | 3955 "recover": (recover, []), |
3954 "^remove|rm": | 3956 "^remove|rm": |
3955 (remove, | 3957 (remove, |