# HG changeset patch # User Christian Delahousse # Date 1447196936 28800 # Node ID ef5bab63af85b74914c3e8ea59cf8abf73a8571c # Parent 263edb591b72babf930ef6b4c69c7ce515ca7c55 largefiles: specify where .orig files are kept This patch let's the user specify where .orig files are kept using the cmdutil.origpath function diff -r 263edb591b72 -r ef5bab63af85 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Tue Nov 10 14:52:54 2015 -0800 +++ b/hgext/largefiles/lfcommands.py Tue Nov 10 15:08:56 2015 -0800 @@ -444,12 +444,14 @@ updated, removed = 0, 0 for lfile in lfiles: abslfile = repo.wjoin(lfile) + abslfileorig = cmdutil.origpath(ui, repo, abslfile) absstandin = repo.wjoin(lfutil.standin(lfile)) + absstandinorig = cmdutil.origpath(ui, repo, absstandin) if os.path.exists(absstandin): - if (os.path.exists(absstandin + '.orig') and + if (os.path.exists(absstandinorig) and os.path.exists(abslfile)): - shutil.copyfile(abslfile, abslfile + '.orig') - util.unlinkpath(absstandin + '.orig') + shutil.copyfile(abslfile, abslfileorig) + util.unlinkpath(absstandinorig) expecthash = lfutil.readstandin(repo, lfile) if expecthash != '': if lfile not in repo[None]: # not switched to normal file diff -r 263edb591b72 -r ef5bab63af85 tests/test-largefiles-misc.t --- a/tests/test-largefiles-misc.t Tue Nov 10 14:52:54 2015 -0800 +++ b/tests/test-largefiles-misc.t Tue Nov 10 15:08:56 2015 -0800 @@ -509,6 +509,18 @@ $ hg revert anotherlarge $ hg st ? sub/anotherlarge.orig + +Test orig files go where we want them + $ echo moremore >> anotherlarge + $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups' + creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub + saving current version of ../.hglf/sub/anotherlarge as $TESTTMP/addrm2/.hg/origbackups/.hglf/sub/anotherlarge.orig + reverting ../.hglf/sub/anotherlarge (glob) + creating directory: $TESTTMP/addrm2/.hg/origbackups/sub + found 90c622cf65cebe75c5842f9136c459333faf392e in store + found 90c622cf65cebe75c5842f9136c459333faf392e in store + $ ls ../.hg/origbackups/sub + anotherlarge.orig $ cd .. Test glob logging from the root dir