##// END OF EJS Templates
commit: move editor outside transaction...
Matt Mackall -
r8496:a21605de default
parent child Browse files
Show More
@@ -810,9 +810,14 b' class localrepository(repo.repository):'
810 810 if f in ms and ms[f] == 'u':
811 811 raise util.Abort(_("unresolved merge conflicts "
812 812 "(see hg resolve)"))
813
813 814 wctx = context.workingctx(self, (p1, p2), text, user, date,
814 815 extra, changes)
815 ret = self.commitctx(wctx, editor, True)
816 if editor:
817 wctx._text = editor(self, wctx,
818 changes[1], changes[0], changes[2])
819
820 ret = self.commitctx(wctx, True)
816 821 ms.reset()
817 822
818 823 # update dirstate
@@ -829,7 +834,7 b' class localrepository(repo.repository):'
829 834 self.dirstate.invalidate() # didn't successfully commit
830 835 wlock.release()
831 836
832 def commitctx(self, ctx, editor=None, error=False):
837 def commitctx(self, ctx, error=False):
833 838 """Add a new revision to current repository.
834 839
835 840 Revision information is passed via the context argument.
@@ -870,13 +875,6 b' class localrepository(repo.repository):'
870 875 else:
871 876 remove.append(f)
872 877
873 updated, added = [], []
874 for f in sorted(changed):
875 if f in m1 or f in m2:
876 updated.append(f)
877 else:
878 added.append(f)
879
880 878 # update manifest
881 879 m1.update(new)
882 880 removed = [f for f in sorted(remove) if f in m1 or f in m2]
@@ -890,9 +888,6 b' class localrepository(repo.repository):'
890 888 p2.manifestnode(), (new, removed1))
891 889
892 890 text = ctx.description()
893 if editor:
894 text = editor(self, ctx, added, updated, removed)
895
896 891 lines = [line.rstrip() for line in text.rstrip().splitlines()]
897 892 while lines and not lines[0]:
898 893 del lines[0]
@@ -1,6 +1,4 b''
1 1 % commit date test
2 transaction abort!
3 rollback completed
4 2 abort: empty commit message
5 3 abort: impossible time zone offset: 4444444
6 4 abort: invalid date: '1\t15.1'
@@ -116,6 +114,4 b" HG: branch 'default'"
116 114 HG: added added
117 115 HG: changed changed
118 116 HG: removed removed
119 transaction abort!
120 rollback completed
121 117 abort: empty commit message
@@ -32,8 +32,6 b' added 1 changesets with 2 changes to 2 f'
32 32 updating working directory
33 33 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 34 applying ../tip.patch
35 transaction abort!
36 rollback completed
37 35 abort: empty commit message
38 36 % import of plain diff should be ok with message
39 37 requesting all changes
@@ -150,8 +148,6 b' added 1 changesets with 2 changes to 2 f'
150 148 updating working directory
151 149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 150 applying patch from stdin
153 transaction abort!
154 rollback completed
155 151 abort: empty commit message
156 152 % hg export in email, should use patch header
157 153 requesting all changes
@@ -112,10 +112,6 b' A a'
112 112 A b
113 113 % default keyword expansion including commit hook
114 114 % interrupted commit should not change state or run commit hook
115 a
116 b
117 transaction abort!
118 rollback completed
119 115 abort: empty commit message
120 116 % status
121 117 A a
@@ -281,8 +277,6 b' xxx $'
281 277 ignore $Id$
282 278 a
283 279 % interrupted commit should not change state
284 transaction abort!
285 rollback completed
286 280 abort: empty commit message
287 281 % status
288 282 M a
@@ -53,9 +53,7 b' date: Thu Jan 01 00:00:00 1970 +0'
53 53 % select files but no hunks
54 54 diff --git a/empty-rw b/empty-rw
55 55 new file mode 100644
56 examine changes to 'empty-rw'? [Ynsfdaq?] transaction abort!
57 rollback completed
58 abort: empty commit message
56 examine changes to 'empty-rw'? [Ynsfdaq?] abort: empty commit message
59 57
60 58 changeset: -1:000000000000
61 59 tag: tip
General Comments 0
You need to be logged in to leave comments. Login now