Show More
@@ -72,7 +72,7 b' def split(ui, repo, *revs, **opts):' | |||||
72 | with repo.wlock(), repo.lock(), repo.transaction(b'split') as tr: |
|
72 | with repo.wlock(), repo.lock(), repo.transaction(b'split') as tr: | |
73 | revs = scmutil.revrange(repo, revlist or [b'.']) |
|
73 | revs = scmutil.revrange(repo, revlist or [b'.']) | |
74 | if len(revs) > 1: |
|
74 | if len(revs) > 1: | |
75 |
raise error. |
|
75 | raise error.InputError(_(b'cannot split multiple revisions')) | |
76 |
|
76 | |||
77 | rev = revs.first() |
|
77 | rev = revs.first() | |
78 | ctx = repo[rev] |
|
78 | ctx = repo[rev] | |
@@ -82,7 +82,7 b' def split(ui, repo, *revs, **opts):' | |||||
82 | ui.status(_(b'nothing to split\n')) |
|
82 | ui.status(_(b'nothing to split\n')) | |
83 | return 1 |
|
83 | return 1 | |
84 | if ctx.node() is None: |
|
84 | if ctx.node() is None: | |
85 |
raise error. |
|
85 | raise error.InputError(_(b'cannot split working directory')) | |
86 |
|
86 | |||
87 | if opts.get(b'rebase'): |
|
87 | if opts.get(b'rebase'): | |
88 | # Skip obsoleted descendants and their descendants so the rebase |
|
88 | # Skip obsoleted descendants and their descendants so the rebase | |
@@ -98,7 +98,7 b' def split(ui, repo, *revs, **opts):' | |||||
98 | rewriteutil.precheck(repo, [rev] + torebase, b'split') |
|
98 | rewriteutil.precheck(repo, [rev] + torebase, b'split') | |
99 |
|
99 | |||
100 | if len(ctx.parents()) > 1: |
|
100 | if len(ctx.parents()) > 1: | |
101 |
raise error. |
|
101 | raise error.InputError(_(b'cannot split a merge changeset')) | |
102 |
|
102 | |||
103 | cmdutil.bailifchanged(repo) |
|
103 | cmdutil.bailifchanged(repo) | |
104 |
|
104 | |||
@@ -170,7 +170,7 b' def dosplit(ui, repo, tr, ctx, opts):' | |||||
170 | committed.append(newctx) |
|
170 | committed.append(newctx) | |
171 |
|
171 | |||
172 | if not committed: |
|
172 | if not committed: | |
173 |
raise error. |
|
173 | raise error.InputError(_(b'cannot split an empty revision')) | |
174 |
|
174 | |||
175 | scmutil.cleanupnodes( |
|
175 | scmutil.cleanupnodes( | |
176 | repo, |
|
176 | repo, |
@@ -51,7 +51,7 b' Nothing to split' | |||||
51 | $ hg commit -m empty --config ui.allowemptycommit=1 |
|
51 | $ hg commit -m empty --config ui.allowemptycommit=1 | |
52 | $ hg split |
|
52 | $ hg split | |
53 | abort: cannot split an empty revision |
|
53 | abort: cannot split an empty revision | |
54 |
[ |
|
54 | [10] | |
55 |
|
55 | |||
56 | $ rm -rf .hg |
|
56 | $ rm -rf .hg | |
57 | $ hg init |
|
57 | $ hg init | |
@@ -60,7 +60,7 b' Cannot split working directory' | |||||
60 |
|
60 | |||
61 | $ hg split -r 'wdir()' |
|
61 | $ hg split -r 'wdir()' | |
62 | abort: cannot split working directory |
|
62 | abort: cannot split working directory | |
63 |
[ |
|
63 | [10] | |
64 |
|
64 | |||
65 | Generate some content. The sed filter drop CR on Windows, which is dropped in |
|
65 | Generate some content. The sed filter drop CR on Windows, which is dropped in | |
66 | the a > b line. |
|
66 | the a > b line. | |
@@ -103,7 +103,7 b' Split a head' | |||||
103 |
|
103 | |||
104 | $ hg split 'all()' |
|
104 | $ hg split 'all()' | |
105 | abort: cannot split multiple revisions |
|
105 | abort: cannot split multiple revisions | |
106 |
[ |
|
106 | [10] | |
107 |
|
107 | |||
108 | This function splits a bit strangely primarily to avoid changing the behavior of |
|
108 | This function splits a bit strangely primarily to avoid changing the behavior of | |
109 | the test after a bug was fixed with how split/commit --interactive handled |
|
109 | the test after a bug was fixed with how split/commit --interactive handled |
General Comments 0
You need to be logged in to leave comments.
Login now