##// END OF EJS Templates
graft: move commit info building...
David Schleimer -
r18038:f8aee803 default
parent child Browse files
Show More
@@ -2837,6 +2837,20 b' def graft(ui, repo, *revs, **opts):'
2837 2837 if opts.get('dry_run'):
2838 2838 continue
2839 2839
2840 source = ctx.extra().get('source')
2841 if not source:
2842 source = ctx.hex()
2843 extra = {'source': source}
2844 user = ctx.user()
2845 if opts.get('user'):
2846 user = opts['user']
2847 date = ctx.date()
2848 if opts.get('date'):
2849 date = opts['date']
2850 message = ctx.description()
2851 if opts.get('log'):
2852 message += '\n(grafted from %s)' % ctx.hex()
2853
2840 2854 # we don't merge the first commit when continuing
2841 2855 if not cont:
2842 2856 # perform the graft merge with p1(rev) as 'ancestor'
@@ -2865,19 +2879,6 b' def graft(ui, repo, *revs, **opts):'
2865 2879 cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev())
2866 2880
2867 2881 # commit
2868 source = ctx.extra().get('source')
2869 if not source:
2870 source = ctx.hex()
2871 extra = {'source': source}
2872 user = ctx.user()
2873 if opts.get('user'):
2874 user = opts['user']
2875 date = ctx.date()
2876 if opts.get('date'):
2877 date = opts['date']
2878 message = ctx.description()
2879 if opts.get('log'):
2880 message += '\n(grafted from %s)' % ctx.hex()
2881 2882 node = repo.commit(text=message, user=user,
2882 2883 date=date, extra=extra, editor=editor)
2883 2884 if node is None:
General Comments 0
You need to be logged in to leave comments. Login now