comparison mercurial/localrepo.py @ 2109:1b183976e007

Revert push new heads logic This breaks push -r's new head detection but fixes the common case. For now we'll assume that someone doing push -r knows what they're doing.
author Matt Mackall <mpm@selenic.com>
date Fri, 21 Apr 2006 16:30:23 -0500
parents 30c7564f6dfc
children 8a1e2a9c7013
comparison
equal deleted inserted replaced
2108:30c7564f6dfc 2109:1b183976e007
1037 1037
1038 if not bases: 1038 if not bases:
1039 self.ui.status(_("no changes found\n")) 1039 self.ui.status(_("no changes found\n"))
1040 return 1 1040 return 1
1041 elif not force: 1041 elif not force:
1042 if revs is not None: 1042 # FIXME we don't properly detect creation of new heads
1043 updated_heads = {} 1043 # in the push -r case, assume the user knows what he's doing
1044 for base in msng_cl: 1044 if not revs and len(remote_heads) < len(heads) \
1045 for parent in self.changelog.parents(base): 1045 and remote_heads != [nullid]:
1046 if parent in remote_heads:
1047 updated_heads[parent] = True
1048 updated_heads = updated_heads.keys()
1049 if len(updated_heads) < len(heads):
1050 self.ui.warn(_("abort: push creates new remote branches!\n")) 1046 self.ui.warn(_("abort: push creates new remote branches!\n"))
1051 self.ui.status(_("(did you forget to merge?" 1047 self.ui.status(_("(did you forget to merge?"
1052 " use push -f to force)\n")) 1048 " use push -f to force)\n"))
1053 return 1 1049 return 1
1054 1050