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