diff hgext/convert/__init__.py @ 25558:daf9f7ee2a5c

convert: support incremental conversion with hg subrepos This was implied in issue3486, which specifically asked for subrepo support in lfconvert. Now that lfconvert uses the convert extension internally when going to normal files, the issue is half fixed. But now even non largefile repos benefit when other transformations are needed. Supporting a full subrepo tree conversion from a single command doesn't seem reasonable, given the number of options that can be provided, and the transformations that would need to occur when entering a subrepo (consider 'filemap' paths). Instead, this allows the user to incrementally convert each hg subrepo from bottom up like so: # so convert knows the dest type when it sees a non empty dest dir $ hg init converted $ hg convert orig/sub1 converted/sub1 $ hg convert orig/sub2 converted/sub2 $ hg convert orig converted This allows different options to be applied to different subrepos more readily. It assumes the shamap is in the default location in each converted subrepo for simplicity. It also allows for a subrepo to be cloned into place, in case _it_ doesn't need a conversion. I was able to convert away from using largefiles/bfiles in several subrepos with this mechanism.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 29 May 2015 13:25:34 -0400
parents 80c5b2666a96
children 86fe3c404c1e
line wrap: on
line diff
--- a/hgext/convert/__init__.py	Fri Jun 05 13:41:14 2015 -0700
+++ b/hgext/convert/__init__.py	Fri May 29 13:25:34 2015 -0400
@@ -328,6 +328,23 @@
     Mercurial Destination
     #####################
 
+    The Mercurial destination will recognize Mercurial subrepositories in the
+    destination directory, and update the .hgsubstate file automatically if the
+    destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
+    Converting a repository with subrepositories requires converting a single
+    repository at a time, from the bottom up.
+
+    .. container:: verbose
+
+       An example showing how to convert a repository with subrepositories::
+
+         # so convert knows the type when it sees a non empty destination
+         $ hg init converted
+
+         $ hg convert orig/sub1 converted/sub1
+         $ hg convert orig/sub2 converted/sub2
+         $ hg convert orig converted
+
     The following options are supported:
 
     :convert.hg.clonebranches: dispatch source branches in separate