equal
deleted
inserted
replaced
50 |
50 |
51 if mod or add or rem: |
51 if mod or add or rem: |
52 raise util.Abort(_('outstanding uncommitted changes')) |
52 raise util.Abort(_('outstanding uncommitted changes')) |
53 if del_: |
53 if del_: |
54 raise util.Abort(_('working directory is missing some files')) |
54 raise util.Abort(_('working directory is missing some files')) |
55 if len(repo.branchheads(branch)) > 1: |
55 bheads = repo.branchheads(branch) |
|
56 bheads = [head for head in bheads if len(repo[head].children()) == 0] |
|
57 if len(bheads) > 1: |
56 raise util.Abort(_('multiple heads in this branch ' |
58 raise util.Abort(_('multiple heads in this branch ' |
57 '(use "hg heads ." and "hg merge" to merge)')) |
59 '(use "hg heads ." and "hg merge" to merge)')) |
58 |
60 |
59 cmdutil.setremoteconfig(ui, opts) |
61 cmdutil.setremoteconfig(ui, opts) |
60 |
62 |
74 if modheads == 0: |
76 if modheads == 0: |
75 return 0 |
77 return 0 |
76 |
78 |
77 # Is this a simple fast-forward along the current branch? |
79 # Is this a simple fast-forward along the current branch? |
78 newheads = repo.branchheads(branch) |
80 newheads = repo.branchheads(branch) |
|
81 newheads = [head for head in newheads if len(repo[head].children()) == 0] |
79 newchildren = repo.changelog.nodesbetween([parent], newheads)[2] |
82 newchildren = repo.changelog.nodesbetween([parent], newheads)[2] |
80 if len(newheads) == 1: |
83 if len(newheads) == 1: |
81 if newchildren[0] != parent: |
84 if newchildren[0] != parent: |
82 return hg.clean(repo, newchildren[0]) |
85 return hg.clean(repo, newchildren[0]) |
83 else: |
86 else: |