Changeset 1558 in tailor
- Timestamp:
- 05/26/08 02:20:06 (5 years ago)
- Hash name:
- 20080526002006-97f81-2e3195fa9cd2b66dcaa7d4d3f572ef03bd0f04a6
- Files:
-
- 3 edited
-
vcpx/repository/darcs/__init__.py (modified) (1 diff)
-
README.rst (modified) (2 diffs)
-
vcpx/repository/darcs/target.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/repository/darcs/__init__.py
r1544 r1558 32 32 self.init_options = None 33 33 self.use_look_for_adds = cget(self.name, 'look-for-adds', 'False') 34 self.split_initial_import_level = int( 35 cget(self.name, 'split-initial-changeset-level', '0')) 34 36 self.replace_badchars = eval(cget(self.name, 'replace-badchars', 35 37 "{" -
README.rst
r1556 r1558 899 899 ``subdir`` different from ``.``. [#]_ 900 900 901 split-initial-changeset-level : integer 902 Sometime it's desiderable to avoid the impact of the huge patch 903 produced by the bootstrap step, that's basically a snapshot of the 904 *whole* working directory. This option controls that: if greater 905 than zero, the inital import will be splitted in multiple 906 changesets, one per directory not deeper than the specified level. A 907 value of 1 will build a changeset for the top level contents 908 (directories and files), then a changeset for each subtree. Finally, 909 a *tag* will comprehend all the changesets. 910 911 *0* by default. 901 912 902 913 Big repositories … … 917 928 done 918 929 930 When darcs is the *target*, consider setting a value of 1 or even 2 931 for the option `split-initial-changeset-level`. 919 932 920 933 git target -
vcpx/repository/darcs/target.py
r1544 r1558 30 30 A target working directory under ``darcs``. 31 31 """ 32 33 def importFirstRevision(self, source_repo, changeset, initial): 34 from os import walk, sep 35 from os.path import join 36 from vcpx.dualwd import IGNORED_METADIRS 37 38 if not self.repository.split_initial_import_level: 39 super(DarcsTargetWorkingDir, self).importFirstRevision( 40 source_repo, changeset, initial) 41 else: 42 cmd = self.repository.command("add", "--case-ok", "--quiet") 43 add = ExternalCommand(cwd=self.repository.basedir, command=cmd) 44 cmd = self.repository.command("add", "--case-ok", "--recursive", 45 "--quiet") 46 addrecurs = ExternalCommand(cwd=self.repository.basedir, command=cmd) 47 for root, dirs, files in walk(self.repository.basedir): 48 subtree = root[len(self.repository.basedir)+1:] 49 if subtree: 50 log = "Import of subtree %s" % subtree 51 level = len(subtree.split(sep)) 52 else: 53 log = "Import of first level" 54 level = 0 55 for excd in IGNORED_METADIRS: 56 if excd in dirs: 57 dirs.remove(excd) 58 if level>self.repository.split_initial_import_level: 59 while dirs: 60 d = dirs.pop(0) 61 addrecurs.execute(join(subtree, d)) 62 filenames = [join(subtree, f) for f in files] 63 if filenames: 64 add.execute(*filenames) 65 else: 66 dirnames = [join(subtree, d) for d in dirs] 67 if dirnames: 68 add.execute(*dirnames) 69 filenames = [join(subtree, f) for f in files] 70 if filenames: 71 add.execute(*filenames) 72 self._commit(changeset.date, "tailor", "Initial import", 73 log, isinitialcommit=initial) 74 75 cmd = self.repository.command("tag", "--author", "tailor") 76 ExternalCommand(cwd=self.repository.basedir, command=cmd).execute( 77 "Initial import from %s" % source_repo.repository) 32 78 33 79 def _addSubtree(self, subdir):
Note: See TracChangeset
for help on using the changeset viewer.
