equal
deleted
inserted
replaced
2084 extra = {} |
2084 extra = {} |
2085 if opts.get('close_branch') or opts.get('force_close_branch'): |
2085 if opts.get('close_branch') or opts.get('force_close_branch'): |
2086 extra[b'close'] = b'1' |
2086 extra[b'close'] = b'1' |
2087 |
2087 |
2088 if repo[b'.'].closesbranch(): |
2088 if repo[b'.'].closesbranch(): |
2089 raise error.InputError( |
2089 # Not ideal, but let us do an extra status early to prevent early |
2090 _(b'current revision is already a branch closing head') |
2090 # bail out. |
2091 ) |
2091 matcher = scmutil.match(repo[None], pats, opts) |
2092 elif not bheads: |
2092 s = repo.status(match=matcher) |
|
2093 if s.modified or s.added or s.removed: |
|
2094 bheads = repo.branchheads(branch, closed=True) |
|
2095 else: |
|
2096 msg = _(b'current revision is already a branch closing head') |
|
2097 raise error.InputError(msg) |
|
2098 |
|
2099 if not bheads: |
2093 raise error.InputError( |
2100 raise error.InputError( |
2094 _(b'branch "%s" has no heads to close') % branch |
2101 _(b'branch "%s" has no heads to close') % branch |
2095 ) |
2102 ) |
2096 elif ( |
2103 elif ( |
2097 branch == repo[b'.'].branch() |
2104 branch == repo[b'.'].branch() |