##// END OF EJS Templates
uncommit: inform user if the commit is empty after uncommit...
Martin von Zweigbergk -
r41911:83d294c7 default
parent child Browse files
Show More
@@ -64,11 +64,11 b' def _commitfiltered(repo, ctx, match, ke'
64 if not exclude:
64 if not exclude:
65 return None
65 return None
66
66
67 files = (initialfiles - exclude)
68 # return the p1 so that we don't create an obsmarker later
67 # return the p1 so that we don't create an obsmarker later
69 if not keepcommit:
68 if not keepcommit:
70 return ctx.p1().node()
69 return ctx.p1().node()
71
70
71 files = (initialfiles - exclude)
72 # Filter copies
72 # Filter copies
73 copied = copiesmod.pathcopies(base, ctx)
73 copied = copiesmod.pathcopies(base, ctx)
74 copied = dict((dst, src) for dst, src in copied.iteritems()
74 copied = dict((dst, src) for dst, src in copied.iteritems()
@@ -83,6 +83,9 b' def _commitfiltered(repo, ctx, match, ke'
83 copied=copied.get(path))
83 copied=copied.get(path))
84 return mctx
84 return mctx
85
85
86 if not files:
87 repo.ui.status(_("note: keeping empty commit\n"))
88
86 new = context.memctx(repo,
89 new = context.memctx(repo,
87 parents=[base.node(), node.nullid],
90 parents=[base.node(), node.nullid],
88 text=ctx.description(),
91 text=ctx.description(),
@@ -158,6 +158,7 b' Uncommit with dirty state'
158 abort: uncommitted changes
158 abort: uncommitted changes
159 [255]
159 [255]
160 $ hg uncommit files
160 $ hg uncommit files
161 note: keeping empty commit
161 $ cat files
162 $ cat files
162 abcde
163 abcde
163 foo
164 foo
@@ -281,6 +282,7 b' Uncommit with draft parent'
281 Phase is preserved
282 Phase is preserved
282
283
283 $ hg uncommit --keep --config phases.new-commit=secret
284 $ hg uncommit --keep --config phases.new-commit=secret
285 note: keeping empty commit
284 $ hg phase -r .
286 $ hg phase -r .
285 15: draft
287 15: draft
286 $ hg commit --amend -m 'update ab again'
288 $ hg commit --amend -m 'update ab again'
@@ -317,6 +319,7 b' Uncommit leaving an empty changeset'
317 > EOS
319 > EOS
318 $ hg up Q -q
320 $ hg up Q -q
319 $ hg uncommit --keep
321 $ hg uncommit --keep
322 note: keeping empty commit
320 $ hg log -G -T '{desc} FILES: {files}'
323 $ hg log -G -T '{desc} FILES: {files}'
321 @ Q FILES:
324 @ Q FILES:
322 |
325 |
General Comments 0
You need to be logged in to leave comments. Login now