Mercurial > hg
comparison hgext/split.py @ 46923:8ee1ac083ee7
split: fix issue with empty splits adjusting phases
Differential Revision: https://phab.mercurial-scm.org/D10388
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Mon, 12 Apr 2021 17:52:46 -0700 |
parents | 728d89f6f9b1 |
children | ca0049946e9a |
comparison
equal
deleted
inserted
replaced
46922:17368844f786 | 46923:8ee1ac083ee7 |
---|---|
169 b'edit': True, | 169 b'edit': True, |
170 b'interactive': True, | 170 b'interactive': True, |
171 b'message': header + ctx.description(), | 171 b'message': header + ctx.description(), |
172 } | 172 } |
173 ) | 173 ) |
174 origctx = repo[b'.'] | |
174 commands.commit(ui, repo, **pycompat.strkwargs(opts)) | 175 commands.commit(ui, repo, **pycompat.strkwargs(opts)) |
175 newctx = repo[b'.'] | 176 newctx = repo[b'.'] |
176 committed.append(newctx) | 177 # Ensure user didn't do a "no-op" split (such as deselecting |
178 # everything). | |
179 if origctx.node() != newctx.node(): | |
180 committed.append(newctx) | |
177 | 181 |
178 if not committed: | 182 if not committed: |
179 raise error.InputError(_(b'cannot split an empty revision')) | 183 raise error.InputError(_(b'cannot split an empty revision')) |
180 | 184 |
181 scmutil.cleanupnodes( | 185 scmutil.cleanupnodes( |