Vladimir Kotal wrote:
> Hi all,
> 
> lib/python/onbld/Scm/Backup.py does backup of .hg/hgrc which contains 
> the path to parent. This breaks things if backup repository uses local 
> clone and restore repository another local clone (model where sparse 
> builds are done locally and nightlies on build machine e.g. in another 
> geo are pretty common AFAIK).
> 
> Does this sound like a bug to anyone ?

wx_backup() in wx previously only provided backup of active list 
metadata plus the actual data files and it ignored Codemgr_wsdata 
directory contents (which contains 'parent' file with path to parent 
workspace) so it's definitely a change in the behavior.

CR 6738179 filed.

> If not, pre-restore/post-restore hooks will solve this.

Crude workaround:
   - add the following lines to the [hooks] section in ~/.hgrc:
     pre-restore=pre_restore.ksh
     post-restore=post_restore.ksh
   - create the scripts (sans error checking) and make sure they are in PATH
     - pre_restore.ksh:

hgrc_file=".hg/hgrc"
hgrc_file_paths_orig="$hgrc_file.paths"
/usr/bin/sed -n '/^\[paths\]/,/^[ \t]*$/p' "$hgrc_file" \
         > "$hgrc_file_paths_orig" || exit 1

     - post_restore.ksh:

hgrc_file=".hg/hgrc"
hgrc_file_paths_orig="$hgrc_file.paths"
tmp_file=`/usr/bin/mktemp /tmp/restore_hook.XXX`
( /usr/bin/sed '/^\[paths\]/,/^[ \t]*$/d' "$hgrc_file"; echo; \
     cat "$hgrc_file_paths_orig" ) > "$tmp_file" || exit 1
mv "$tmp_file" "$hgrc_file" || exit 1



v.

Reply via email to