##// END OF EJS Templates
revert: allow configuring the .orig file location
Christian Delahousse -
r26938:080276d3 default
parent child Browse files
Show More
@@ -3082,7 +3082,7 def revert(ui, repo, ctx, parents, *pats
3082 xlist.append(abs)
3082 xlist.append(abs)
3083 if dobackup and (backup <= dobackup
3083 if dobackup and (backup <= dobackup
3084 or wctx[abs].cmp(ctx[abs])):
3084 or wctx[abs].cmp(ctx[abs])):
3085 bakname = "%s.orig" % rel
3085 bakname = origpath(ui, repo, rel)
3086 ui.note(_('saving current version of %s as %s\n') %
3086 ui.note(_('saving current version of %s as %s\n') %
3087 (rel, bakname))
3087 (rel, bakname))
3088 if not opts.get('dry_run'):
3088 if not opts.get('dry_run'):
@@ -86,6 +86,16 Test creation of backup (.orig) files
86 saving current version of e as e.orig
86 saving current version of e as e.orig
87 reverting e
87 reverting e
88
88
89 Test creation of backup (.orig) file in configured file location
90 ----------------------------------------------------------------
91
92 $ echo z > e
93 $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
94 creating directory: $TESTTMP/repo/.hg/origbackups
95 saving current version of e as $TESTTMP/repo/.hg/origbackups/e.orig
96 reverting e
97 $ rm -rf .hg/origbackups
98
89 revert on clean file (no change)
99 revert on clean file (no change)
90 --------------------------------
100 --------------------------------
91
101
General Comments 0
You need to be logged in to leave comments. Login now