Show More
@@ -2794,8 +2794,6 b' def commit(ui, repo, commitfunc, pats, o' | |||||
2794 | date = opts.get(b'date') |
|
2794 | date = opts.get(b'date') | |
2795 | if date: |
|
2795 | if date: | |
2796 | opts[b'date'] = dateutil.parsedate(date) |
|
2796 | opts[b'date'] = dateutil.parsedate(date) | |
2797 | message = logmessage(ui, opts) |
|
|||
2798 | matcher = scmutil.match(repo[None], pats, opts) |
|
|||
2799 |
|
2797 | |||
2800 | dsguard = None |
|
2798 | dsguard = None | |
2801 | # extract addremove carefully -- this function can be called from a command |
|
2799 | # extract addremove carefully -- this function can be called from a command | |
@@ -2803,13 +2801,27 b' def commit(ui, repo, commitfunc, pats, o' | |||||
2803 | if opts.get(b'addremove'): |
|
2801 | if opts.get(b'addremove'): | |
2804 | dsguard = dirstateguard.dirstateguard(repo, b'commit') |
|
2802 | dsguard = dirstateguard.dirstateguard(repo, b'commit') | |
2805 | with dsguard or util.nullcontextmanager(): |
|
2803 | with dsguard or util.nullcontextmanager(): | |
2806 | if dsguard: |
|
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'): | |||
2807 | relative = scmutil.anypats(pats, opts) |
|
2810 | relative = scmutil.anypats(pats, opts) | |
2808 |
uipathfn = scmutil.getuipathfn( |
|
2811 | uipathfn = scmutil.getuipathfn( | |
2809 | if scmutil.addremove(repo, matcher, b"", uipathfn, opts) != 0: |
|
2812 | repo, | |
2810 | raise error.Abort( |
|
2813 | legacyrelativevalue=relative, | |
2811 | _(b"failed to mark all new/missing files as added/removed") |
|
|||
2812 | ) |
|
2814 | ) | |
|
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) | |||
2813 |
|
2825 | |||
2814 | return commitfunc(ui, repo, message, matcher, opts) |
|
2826 | return commitfunc(ui, repo, message, matcher, opts) | |
2815 |
|
2827 |
General Comments 0
You need to be logged in to leave comments.
Login now