Какая структура каталогов имеет смысл для DVCS, такого как мерзавец?

Используйте встроенный min() в :

item_no = [3,5,7,3,5,7,3,5,7,9]

min_val = min(item_no)    # what is the minimal value?

# print item with position
for i,v in enumerate(item_no):
    if v==min_val:
        print(f"{min_val} at position {i}")

# get all min values
all_mins = [i for i in item_no if i==min_val] 
print( all_mins )

Выход:

3 at position 0
3 at position 3
3 at position 6
[3, 3, 3]

11
задан Thomas L Holaday 31 March 2009 в 13:59
поделиться

2 ответа

Из-за пути работает Мерзавец, Вы действительно не хотите помещать рабочие каталоги для репозиториев (или ответвления) в каталоге в соответствии с рабочим каталогом для другого репозитория. Это продолжало бы желать поместить содержание Вашего дочернего каталога в репозиторий родителя.

Если бы Вы идете со всеми ответвлениями, являющимися одноуровневыми каталогами, которые работали бы просто великолепно.

Что я склонен делать (независимо от использования Мерзавца, cvs, или (ick) SourceSafe), имеют каталог Development, и каждый проект, ответвление, и т.д. быть подкаталогом там.

8
ответ дан 3 December 2019 в 05:59
поделиться

I agree with T.E.D.'s answer in that I prefer to keep each project in a development directory. However, when I'm in the terminal looking at a bash listing I like to easily see three things:

  1. What type of repo is this --- Git, Mercurial, or Subversion
  2. Where is the pseudo-central repo stored --- Github.com, Bitbucket.org, Google Code, etc.
  3. Who owns the pseudo-central repo

I've found that I can easily do this by using the following naming convention for my projects:

~/development/project.whatwhere.who

Since it is common when using Mercurial to clone a local project, I add one layer to the directory structure as:

~/development/project.whatwhere.who/project/   # Initial clone from remote repo
~/development/project.whatwhere.who/project.local.blah_descriptor/  # Local hg clone

The whatwhere convention that I use is as follows:

  • github --- Git repo stored on github.com
  • gitorious --- Git repo stored on gitorious.org
  • git --- Git repo stored somewhere elsewhere
  • gitsvn --- Subversion repo cloned using git-svn stored somewhere else
  • hgbit --- Mercurial repo stored on bitbucket.org
  • hg.gcode --- Mercurial repo stored on Google code
  • hg --- Mercurial repo stored elsewhere
  • svn.gcode --- Subversion repo stored on Google code
  • svn.sforge --- Subversion repo stored on Sourceforge.net
  • svn.work ---- Subversion repo stored on our company's svn server
  • svn --- Subversion repo stored somewhere

The who convention is simply the username of the desired person.

Below are a few project examples, all residing in my ~/development/ directory:

fabric.github.bitprophet      # Bitprophet's fabric project cloned from Github
fabric.github.myusername      # My fork of the fabric project from Github
virtualenv.hgbit.ianb         # Ianb's virtualenv project cloned from Bitbucket
growl.hg.gcode                # Growl project cloned from Google code
ledgersmb.svn.sforge          # LedgerSMB project checked out from Sourceforge
coldfire.gitsvn               # Coldfire Subversion project at work cloned using git-svn
coldfire.svn                  # Coldfire Subversion project at work checked out with svn

To help organize your projects if you get too many, you may want to add a layer immediately beneath the ~/development directory for organization. For example, you could have the following directories:

~/development/workprojects/
~/development/opensrcprojects/
~/development/personalprojects/

Note: I typically use Git for DVCS, so this answer is most likely slanted in that direction.

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

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