Show More
@@ -2794,8 +2794,6 b' def commit(ui, repo, commitfunc, pats, o' | |||
|
2794 | 2794 | date = opts.get(b'date') |
|
2795 | 2795 | if date: |
|
2796 | 2796 | opts[b'date'] = dateutil.parsedate(date) |
|
2797 | message = logmessage(ui, opts) | |
|
2798 | matcher = scmutil.match(repo[None], pats, opts) | |
|
2799 | 2797 | |
|
2800 | 2798 | dsguard = None |
|
2801 | 2799 | # extract addremove carefully -- this function can be called from a command |
@@ -2803,15 +2801,29 b' def commit(ui, repo, commitfunc, pats, o' | |||
|
2803 | 2801 | if opts.get(b'addremove'): |
|
2804 | 2802 | dsguard = dirstateguard.dirstateguard(repo, b'commit') |
|
2805 | 2803 | with dsguard or util.nullcontextmanager(): |
|
2806 | if dsguard: | |
|
2807 |
|
|
|
2808 | uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative) | |
|
2809 | if scmutil.addremove(repo, matcher, b"", uipathfn, opts) != 0: | |
|
2810 | raise error.Abort( | |
|
2811 | _(b"failed to mark all new/missing files as added/removed") | |
|
2804 | message = logmessage(ui, opts) | |
|
2805 | matcher = scmutil.match(repo[None], pats, opts) | |
|
2806 | if True: | |
|
2807 | # extract addremove carefully -- this function can be called from a | |
|
2808 | # command that doesn't support addremove | |
|
2809 | if opts.get(b'addremove'): | |
|
2810 | relative = scmutil.anypats(pats, opts) | |
|
2811 | uipathfn = scmutil.getuipathfn( | |
|
2812 | repo, | |
|
2813 | legacyrelativevalue=relative, | |
|
2812 | 2814 | ) |
|
2813 | ||
|
2814 | return commitfunc(ui, repo, message, matcher, opts) | |
|
2815 | r = scmutil.addremove( | |
|
2816 | repo, | |
|
2817 | matcher, | |
|
2818 | b"", | |
|
2819 | uipathfn, | |
|
2820 | opts, | |
|
2821 | ) | |
|
2822 | m = _(b"failed to mark all new/missing files as added/removed") | |
|
2823 | if r != 0: | |
|
2824 | raise error.Abort(m) | |
|
2825 | ||
|
2826 | return commitfunc(ui, repo, message, matcher, opts) | |
|
2815 | 2827 | |
|
2816 | 2828 | |
|
2817 | 2829 | def samefile(f, ctx1, ctx2): |
General Comments 0
You need to be logged in to leave comments.
Login now