Show More
@@ -135,12 +135,24 def dorecord(ui, repo, commitfunc, cmdsu | |||||
135 | """ |
|
135 | """ | |
136 |
|
136 | |||
137 | checkunfinished(repo, commit=True) |
|
137 | checkunfinished(repo, commit=True) | |
138 |
|
|
138 | wctx = repo[None] | |
|
139 | merge = len(wctx.parents()) > 1 | |||
139 | if merge: |
|
140 | if merge: | |
140 | raise error.Abort(_('cannot partially commit a merge ' |
|
141 | raise error.Abort(_('cannot partially commit a merge ' | |
141 | '(use "hg commit" instead)')) |
|
142 | '(use "hg commit" instead)')) | |
142 |
|
143 | |||
|
144 | def fail(f, msg): | |||
|
145 | raise error.Abort('%s: %s' % (f, msg)) | |||
|
146 | ||||
|
147 | force = opts.get('force') | |||
|
148 | if not force: | |||
|
149 | vdirs = [] | |||
|
150 | match.explicitdir = vdirs.append | |||
|
151 | match.bad = fail | |||
|
152 | ||||
143 | status = repo.status(match=match) |
|
153 | status = repo.status(match=match) | |
|
154 | if not force: | |||
|
155 | repo.checkcommitpatterns(wctx, vdirs, match, status, fail) | |||
144 | diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True) |
|
156 | diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True) | |
145 | diffopts.nodates = True |
|
157 | diffopts.nodates = True | |
146 | diffopts.git = True |
|
158 | diffopts.git = True |
@@ -59,6 +59,14 Select files but no hunks | |||||
59 |
|
59 | |||
60 |
|
60 | |||
61 |
|
61 | |||
|
62 | Abort for untracked | |||
|
63 | ||||
|
64 | $ touch untracked | |||
|
65 | $ hg commit -i -m should-fail empty-rw untracked | |||
|
66 | abort: untracked: file not tracked! | |||
|
67 | [255] | |||
|
68 | $ rm untracked | |||
|
69 | ||||
62 | Record empty file |
|
70 | Record empty file | |
63 |
|
71 | |||
64 | $ hg commit -i -d '0 0' -m empty empty-rw<<EOF |
|
72 | $ hg commit -i -d '0 0' -m empty empty-rw<<EOF |
General Comments 0
You need to be logged in to leave comments.
Login now