Задать вопрос

Тел: +7 965 3737 888

466

Просмотров

5

Ответов

Update All Apps to Latest Revision

<p>A simple script that I have put in my Django applications directory to fetch the latest application code from git and svn.</p>
<p>For example, your directory structure might look like so:</p>
django-apps/
    django-tagging/
    django-pagination/
    django-registration/
    django-threadedcomments/
    django-mptt/
    update_apps.py

<p>Where update_apps.py is the source of this snippet.</p>
<p>To run, simply execute:</p>
<h1>python update_apps.py</h1>
<p>And the script will iterate through all of your apps and update them to the latest version.</p>

Вопрос полезен? Да0/Нет0
file_2860.py(697.0б)
None

Ответы (5):

Ответmikl:02.01.2009
Ответ полезен? Да0/Нет0

Nice trick, but I'm pretty sure that your env usage is wrong – it's supposed to be something like this:

#!/usr/bin/env python

Ответizibi:16.07.2008
Ответ полезен? Да0/Нет0

Great snippet, but is it possible to add Mercurial support?

The update command is hg -u pull

Ответericflo:02.07.2008
Ответ полезен? Да0/Нет0

@kcarnold: That's a really great solution when all of your applications are within a subversion project, and we do it that way for the Pinax project. That being said, I like to keep a separate global directory just for Django apps, and this script addresses that particular use case.

Ответdnordberg:02.07.2008
Ответ полезен? Да0/Нет0

Thanks! been wanting this for sometime

Ответkcarnold:01.07.2008
Ответ полезен? Да0/Нет0

Subversion has an "externals" facility that works well in this situation: simply define all your external apps (even Django itself, perhaps) in svn:externals, then an svn up will pull all the latest versions. (You can also lock a specific revision.)

I think git has something similar, but I don't know how it works.