Show More
@@ -800,11 +800,24 b' def creatediff(ctx):' | |||
|
800 | 800 | """create a Differential Diff""" |
|
801 | 801 | repo = ctx.repo() |
|
802 | 802 | repophid = getrepophid(repo) |
|
803 |
# Create a "Differential Diff" via "differential.create |
|
|
804 | params = {b'diff': getdiff(ctx, mdiff.diffopts(git=True, context=32767))} | |
|
803 | # Create a "Differential Diff" via "differential.creatediff" API | |
|
804 | pdiff = phabdiff( | |
|
805 | sourceControlBaseRevision=b'%s' % ctx.p1().hex(), | |
|
806 | branch=b'%s' % ctx.branch(), | |
|
807 | ) | |
|
808 | modified, added, removed, _d, _u, _i, _c = ctx.p1().status(ctx) | |
|
809 | # addadded will remove moved files from removed, so addremoved won't get | |
|
810 | # them | |
|
811 | addadded(pdiff, ctx, added, removed) | |
|
812 | addmodified(pdiff, ctx, modified) | |
|
813 | addremoved(pdiff, ctx, removed) | |
|
805 | 814 | if repophid: |
|
806 |
p |
|
|
807 | diff = callconduit(repo.ui, b'differential.createrawdiff', params) | |
|
815 | pdiff.repositoryPHID = repophid | |
|
816 | diff = callconduit( | |
|
817 | repo.ui, | |
|
818 | b'differential.creatediff', | |
|
819 | pycompat.byteskwargs(attr.asdict(pdiff)), | |
|
820 | ) | |
|
808 | 821 | if not diff: |
|
809 | 822 | raise error.Abort(_(b'cannot create diff for %s') % ctx) |
|
810 | 823 | return diff |
@@ -812,8 +825,10 b' def creatediff(ctx):' | |||
|
812 | 825 | |
|
813 | 826 | def writediffproperties(ctx, diff): |
|
814 | 827 | """write metadata to diff so patches could be applied losslessly""" |
|
828 | # creatediff returns with a diffid but query returns with an id | |
|
829 | diffid = diff.get(b'diffid', diff.get(b'id')) | |
|
815 | 830 | params = { |
|
816 |
b'diff_id': diff |
|
|
831 | b'diff_id': diffid, | |
|
817 | 832 | b'name': b'hg:meta', |
|
818 | 833 | b'data': templatefilters.json( |
|
819 | 834 | { |
@@ -828,7 +843,7 b' def writediffproperties(ctx, diff):' | |||
|
828 | 843 | callconduit(ctx.repo().ui, b'differential.setdiffproperty', params) |
|
829 | 844 | |
|
830 | 845 | params = { |
|
831 |
b'diff_id': diff |
|
|
846 | b'diff_id': diffid, | |
|
832 | 847 | b'name': b'local:commits', |
|
833 | 848 | b'data': templatefilters.json( |
|
834 | 849 | { |
General Comments 0
You need to be logged in to leave comments.
Login now