SVN Автоматическое обновление рабочих копий

3231
Jim

Можно ли настроить Subversion, где, когда кто-то фиксирует обновление в хранилище, все извлеченные рабочие копии обновляются автоматически?

заранее спасибо

0
То, что вы хотите, звучит намного больше как Dropbox, чем SVN. David 10 лет назад 0

2 ответа на вопрос

0
Zoredache

Нет, нет Ничто не отслеживает все рабочие копии. Если вы знаете, где находятся все рабочие копии, вы можете написать ловушку, которая обновит все WC. Но нет универсального метода.

0
Ben

No, and if you managed to hack together a solution that did this, I think everybody using it would be upset with you. An svn update forces a merge of any files that the user has modified in their working copy. This merge has the potential to go horribly wrong and lose all their changes if they're not paying attention. In SVN and most other version control systems in common use, the user must explicitly request getting the work other people have done BY DESIGN. This is so a person does not interrupt their own workflow trying to get their changes to compile and run with somebody else's (possibly incomplete) work until they are good and ready to spend the time to get through the merge properly. A DVCS like Mercurial or git (or Fossil or Bazaar or veracity or...) will allow you to pull in changes without merging (and without seeing them in your working copy yet), on those systems it COULD make sense to automatically push changes, but SVN combines the pull with the update so especially in SVN such an automatic update would be a bad idea.

I'll note that version control systems with a "lock, edit, unlock" paradigm actually can work well with an automatic update system. ClearCase works this way, for example. But modern systems are almost always "copy, edit, merge" and therefore do not lend themselves to an automatic update system, since multiple people can work on the same file.

Now, maybe you want specific read-only working copies to get updated automatically, like on a build server or something. THOSE would be a good candidate for a hook script in SVN, or even better a cron job in Unix-like systems or a scheduled task on Windows.

Большое спасибо за информацию. Мои мысли точно, мои пользователи были бы весьма несчастны. Jim 10 лет назад 0

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