Show More
@@ -51,7 +51,7 configitem('experimental', 'uncommitondi | |||
|
51 | 51 | # leave the attribute unspecified. |
|
52 | 52 | testedwith = 'ships-with-hg-core' |
|
53 | 53 | |
|
54 |
def _commitfiltered(repo, ctx, match, |
|
|
54 | def _commitfiltered(repo, ctx, match, keepcommit): | |
|
55 | 55 | """Recommit ctx with changed files not in match. Return the new |
|
56 | 56 | node identifier, or None if nothing changed. |
|
57 | 57 | """ |
@@ -66,7 +66,7 def _commitfiltered(repo, ctx, match, al | |||
|
66 | 66 | |
|
67 | 67 | files = (initialfiles - exclude) |
|
68 | 68 | # return the p1 so that we don't create an obsmarker later |
|
69 | if not files and not allowempty: | |
|
69 | if not keepcommit: | |
|
70 | 70 | return ctx.parents()[0].node() |
|
71 | 71 | |
|
72 | 72 | # Filter copies |
@@ -169,8 +169,8 def uncommit(ui, repo, *pats, **opts): | |||
|
169 | 169 | |
|
170 | 170 | with repo.transaction('uncommit'): |
|
171 | 171 | match = scmutil.match(old, pats, opts) |
|
172 |
|
|
|
173 |
newid = _commitfiltered(repo, old, match, |
|
|
172 | keepcommit = opts.get('keep') or pats | |
|
173 | newid = _commitfiltered(repo, old, match, keepcommit) | |
|
174 | 174 | if newid is None: |
|
175 | 175 | ui.status(_("nothing to uncommit\n")) |
|
176 | 176 | return 1 |
General Comments 0
You need to be logged in to leave comments.
Login now