##// 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 if opts.get('dry_run'):
2837 if opts.get('dry_run'):
2838 continue
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 # we don't merge the first commit when continuing
2854 # we don't merge the first commit when continuing
2841 if not cont:
2855 if not cont:
2842 # perform the graft merge with p1(rev) as 'ancestor'
2856 # perform the graft merge with p1(rev) as 'ancestor'
@@ -2865,19 +2879,6 b' def graft(ui, repo, *revs, **opts):'
2865 cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev())
2879 cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev())
2866
2880
2867 # commit
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 node = repo.commit(text=message, user=user,
2882 node = repo.commit(text=message, user=user,
2882 date=date, extra=extra, editor=editor)
2883 date=date, extra=extra, editor=editor)
2883 if node is None:
2884 if node is None:
General Comments 0
You need to be logged in to leave comments. Login now