Управляемая версией дополнительная конфигурация в Подвижном

И

df <- mutate(df,Combo = as.integer(interaction(Date,Location,drop = TRUE)))

и

df <- mutate(df,Combo = as.integer(factor(paste0(Date,Location))))

являются опциями, хотя они упорядочивают уровни не в том порядке, в котором они появляются в данных.

7
задан Martin Geisler 30 March 2012 в 12:37
поделиться

3 ответа

You want mercurial to do something automatically when you clone a repo (update the hooks or config). Documentation says it is not possible and gives some very good reasons:

Hooks do not propagate

In Mercurial, hooks are not revision controlled, and do not propagate when you clone,
or pull from, a repository. The reason for this is simple: a hook is a completely    
arbitrary piece of executable code. It runs under your user identity, with your 
privilege level, on your machine. No comments

It would be extremely reckless for any distributed revision control system to 
implement revision-controlled hooks, as this would offer an easily exploitable way to 
subvert the accounts of users of the revision control system. No comments

So clearly, mercurial itself won't solve your problem. You clearly state that you want nothing but mercurial to solve your problem, so the answer is: what you are asking is not possible.

The only way to solve your problem is that all your users will have to run/install at least once a given script that perform the actions you want, something like installing the right hooks.

If you want to be clever about this:

  • create a one-time script to run that will install a hook to copy the right config into the .hg or the user
  • make sure that the hook, once installed, can update the script to distribute config updates to the users
  • make the hook add some special marking to commit messages
  • refuse on the central repository commit that do not carry the special message

A bit complicated, but that's the closest I can imagine to your requirements:

  • user run a script once and they forget
  • you can make sure that if the did not run it, they can not commit to your central repo
9
ответ дан 6 December 2019 в 12:54
поделиться

А как насчет создания ссылки из .hg / hgrc , например, на customhg / hgrc , чтобы получить версию. Затем вам нужно создать ловушку, которая копирует его обратно в .hg / hgrc - например, после каждого обновления.

0
ответ дан 6 December 2019 в 12:54
поделиться

Текущая разрабатываемая версия Mercurial (которая будет выпущена 1 июля как Mercurial 1.3) поддерживает директиву % include в своих файлах конфигурации.

Это означает, что вы можно попросить людей поместить

%include ../common-hgrc

в .hg / hgrc . Сделав это, вы сможете эффективно управлять их настройками Mercurial, зафиксировав изменения в common-hgrc . Когда они извлекут изменения, новые настройки вступят в силу.

Обратите внимание, что это опасно: любой, кто может заставить вас загрузить изменения в ваш репозиторий, теперь может вставлять произвольные хуки в common-hgrc и вы выполните их в следующей команде Mercurial (даже в «безопасной» командной строке hg status ).

6
ответ дан 6 December 2019 в 12:54
поделиться
Другие вопросы по тегам:

Похожие вопросы: