Mercurial > hg
comparison hgext/convert/convcmd.py @ 22300:35ab037de989
convert: introduce --full for converting all files
Convert will normally only process files that were changed in a source
revision, apply the filemap, and record it has a change in the target
repository. (If it ends up not really changing anything, nothing changes.)
That means that _if_ the filemap is changed before continuing an incremental
convert, the change will only kick in when the files it affects are modified in
a source revision and thus processed.
With --full, convert will make a full conversion every time and process
all files in the source repo and remove target repo files that shouldn't be
there. Filemap changes will thus kick in on the first converted revision, no
matter what is changed.
This flag should in most cases not make any difference but will make convert
significantly slower.
Other names has been considered for this feature, such as "resync", "sync",
"checkunmodified", "all" or "allfiles", but I found that they were less obvious
and required more explanation than "full" and were harder to describe
consistently.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 26 Aug 2014 22:03:32 +0200 |
parents | 3de9f2c4900c |
children | c497e39d81a3 |
comparison
equal
deleted
inserted
replaced
22299:98aafdf4cbf6 | 22300:35ab037de989 |
---|---|
384 self.commitcache[rev] = commit | 384 self.commitcache[rev] = commit |
385 return commit | 385 return commit |
386 | 386 |
387 def copy(self, rev): | 387 def copy(self, rev): |
388 commit = self.commitcache[rev] | 388 commit = self.commitcache[rev] |
389 | 389 full = self.opts.get('full') |
390 changes = self.source.getchanges(rev) | 390 changes = self.source.getchanges(rev, full) |
391 if isinstance(changes, basestring): | 391 if isinstance(changes, basestring): |
392 if changes == SKIPREV: | 392 if changes == SKIPREV: |
393 dest = SKIPREV | 393 dest = SKIPREV |
394 else: | 394 else: |
395 dest = self.map[changes] | 395 dest = self.map[changes] |
411 parents = [self.map.get(p, p) for p in parents] | 411 parents = [self.map.get(p, p) for p in parents] |
412 except KeyError: | 412 except KeyError: |
413 parents = [b[0] for b in pbranches] | 413 parents = [b[0] for b in pbranches] |
414 source = progresssource(self.ui, self.source, len(files)) | 414 source = progresssource(self.ui, self.source, len(files)) |
415 newnode = self.dest.putcommit(files, copies, parents, commit, | 415 newnode = self.dest.putcommit(files, copies, parents, commit, |
416 source, self.map) | 416 source, self.map, full) |
417 source.close() | 417 source.close() |
418 self.source.converted(rev, newnode) | 418 self.source.converted(rev, newnode) |
419 self.map[rev] = newnode | 419 self.map[rev] = newnode |
420 | 420 |
421 def convert(self, sortmode): | 421 def convert(self, sortmode): |