2014-12-01 22:02:08 +03:00
test sparse
$ hg init myrepo
$ cd myrepo
$ cat > . hg / hgrc << EOF
> [ extensions ]
2018-11-30 13:17:29 +03:00
> sparse =
2014-12-01 22:02:08 +03:00
> purge =
> strip =
> rebase =
> EOF
$ echo a > index . html
$ echo x > data . py
$ echo z > readme . txt
$ cat > webpage . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: frontend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . html
> EOF
$ cat > backend . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: backend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . py
> EOF
$ hg ci - Aqm 'initial'
2018-10-19 16:49:04 +03:00
Show with no sparse profile enabled
$ hg sparse show
No sparse profile enabled
2018-04-18 20:31:28 +03:00
$ hg sparse include '*.sparse'
2014-12-01 22:02:08 +03:00
Verify enabling a single profile works
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile webpage . sparse
2014-12-01 22:02:08 +03:00
$ ls
backend . sparse
index . html
webpage . sparse
Verify enabling two profiles works
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile backend . sparse
2014-12-01 22:02:08 +03:00
$ ls
backend . sparse
data . py
index . html
webpage . sparse
Verify disabling a profile works
2018-04-18 20:31:28 +03:00
$ hg sparse disableprofile webpage . sparse
2014-12-01 22:02:08 +03:00
$ ls
backend . sparse
data . py
webpage . sparse
2018-03-14 16:49:43 +03:00
Verify error checking includes filename and line numbers
$ cat > broken . sparse << EOF
> # include section omitted
> [ exclude ]
> * . html
> /absolute/ paths /are/ig nored
> [ include ]
> EOF
$ hg add broken . sparse
$ hg ci - m 'Adding a broken file'
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile broken . sparse
2018-03-14 16:49:43 +03:00
warning: sparse profile cannot use paths starting with /, ignoring / absolute /paths/ are / ignored , in broken . sparse:4
abort: A sparse file cannot have includes after excludes in broken . sparse:5
[ 255 ]
2018-04-25 18:46:01 +03:00
$ hg - q strip . - - no - backup
2014-12-01 22:02:08 +03:00
Verify that a profile is updated across multiple commits
$ cat > webpage . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: frontend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . html
> EOF
$ cat > backend . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: backend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . py
> * . txt
> EOF
2015-04-10 03:17:03 +03:00
$ echo foo >> data . py
2014-12-01 22:02:08 +03:00
$ hg ci - m 'edit profile'
$ ls
backend . sparse
data . py
readme . txt
webpage . sparse
$ hg up - q 0
$ ls
backend . sparse
data . py
webpage . sparse
$ hg up - q 1
$ ls
backend . sparse
data . py
readme . txt
webpage . sparse
Introduce a conflicting . hgsparse change
$ hg up - q 0
$ cat > backend . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: Different backend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . html
> EOF
2015-04-10 03:17:03 +03:00
$ echo bar >> data . py
2014-12-01 22:02:08 +03:00
$ hg ci - qAm "edit profile other"
$ ls
backend . sparse
index . html
webpage . sparse
2015-04-10 03:17:03 +03:00
Verify conflicting merge pulls in the conflicting changes
2014-12-01 22:02:08 +03:00
$ hg merge 1
2015-04-10 03:17:03 +03:00
temporarily included 1 file ( s ) in the sparse checkout for merging
2014-12-01 22:02:08 +03:00
merging backend . sparse
2015-04-10 03:17:03 +03:00
merging data . py
2018-10-22 22:45:46 +03:00
warning: 1 conflicts while merging backend . sparse ! ( edit , then use 'hg resolve --mark' )
warning: 1 conflicts while merging data . py ! ( edit , then use 'hg resolve --mark' )
2015-04-10 03:17:03 +03:00
0 files updated , 0 files merged , 0 files removed , 2 files unresolved
2014-12-01 22:02:08 +03:00
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
[ 1 ]
$ rm * . orig
$ ls
backend . sparse
data . py
index . html
webpage . sparse
Verify resolving the merge removes the temporarily unioned files
$ cat > backend . sparse << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: backend sparse profile
2014-12-01 22:02:08 +03:00
> [ include ]
> * . html
> * . txt
> EOF
$ hg resolve - m backend . sparse
2015-04-10 03:17:03 +03:00
$ cat > data . py << EOF
> x
> foo
> bar
> EOF
$ hg resolve - m data . py
2014-12-01 22:02:08 +03:00
( no more unresolved files )
$ hg ci - qAm "merge profiles"
$ ls
backend . sparse
index . html
readme . txt
webpage . sparse
2015-04-10 03:17:03 +03:00
$ hg cat - r . data . py
x
foo
bar
2014-12-01 22:02:08 +03:00
Verify stripping refreshes dirstate
2018-04-25 18:46:01 +03:00
$ hg strip - q -r . - - no - backup
2014-12-01 22:02:08 +03:00
$ ls
backend . sparse
index . html
webpage . sparse
2015-04-10 03:17:03 +03:00
Verify rebase conflicts pulls in the conflicting changes
$ hg up - q 1
$ ls
backend . sparse
data . py
readme . txt
webpage . sparse
2014-12-01 22:02:08 +03:00
2015-04-10 03:17:03 +03:00
$ hg rebase - d 2
2018-03-14 16:49:45 +03:00
rebasing 1 : e7901640ca22 "edit profile"
2015-04-10 03:17:03 +03:00
temporarily included 1 file ( s ) in the sparse checkout for merging
2014-12-01 22:02:08 +03:00
merging backend . sparse
2015-04-10 03:17:03 +03:00
merging data . py
2018-10-22 22:45:46 +03:00
warning: 1 conflicts while merging backend . sparse ! ( edit , then use 'hg resolve --mark' )
warning: 1 conflicts while merging data . py ! ( edit , then use 'hg resolve --mark' )
2014-12-01 22:02:08 +03:00
unresolved conflicts ( see hg resolve , then hg rebase - - continue )
[ 1 ]
$ rm * . orig
$ ls
backend . sparse
data . py
index . html
webpage . sparse
2015-04-10 03:17:03 +03:00
Verify resolving conflict removes the temporary files
2014-12-01 22:02:08 +03:00
$ cat > backend . sparse << EOF
> [ include ]
> * . html
> * . txt
> EOF
$ hg resolve - m backend . sparse
2015-04-10 03:17:03 +03:00
$ cat > data . py << EOF
> x
> foo
> bar
> EOF
$ hg resolve - m data . py
2014-12-01 22:02:08 +03:00
( no more unresolved files )
2016-01-21 00:40:15 +03:00
continue : hg rebase - - continue
2014-12-01 22:02:08 +03:00
$ hg rebase - q - - continue
$ ls
backend . sparse
index . html
readme . txt
webpage . sparse
2015-04-04 02:45:36 +03:00
2015-04-10 03:17:03 +03:00
$ hg cat - r . data . py
x
foo
bar
2015-11-19 11:47:45 +03:00
Test checking out a commit that does not contain the sparse profile . The
warning message can be suppressed by setting missingwarning = false in
[ sparse ] section of your config:
2015-04-04 02:45:36 +03:00
2018-04-18 20:31:28 +03:00
$ hg sparse reset
2015-04-04 02:45:36 +03:00
$ hg rm * . sparse
$ hg commit - m "delete profiles"
2016-01-08 05:30:24 +03:00
$ hg up - q ".^"
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile backend . sparse
2015-04-04 02:45:36 +03:00
$ ls
index . html
readme . txt
2015-11-19 11:47:45 +03:00
$ hg up tip | grep warning
[ 1 ]
2015-04-04 02:45:36 +03:00
$ ls
data . py
index . html
readme . txt
2018-04-18 20:31:28 +03:00
$ hg sparse disableprofile backend . sparse | grep warning
2015-11-19 11:47:45 +03:00
[ 1 ]
$ cat >> . hg / hgrc << EOF
> [ sparse ]
2018-10-17 00:19:25 +03:00
> missingwarning = true
2015-11-19 11:47:45 +03:00
> EOF
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile backend . sparse
2018-10-17 00:19:25 +03:00
warning: sparse profile 'backend.sparse' not found in rev 42 b23bc43905 - ignoring it
2015-11-13 21:43:10 +03:00
$ cd ..
Test file permissions changing across a sparse profile change
$ hg init sparseperm
$ cd sparseperm
$ cat > . hg / hgrc << EOF
> [ extensions ]
2018-11-30 13:17:29 +03:00
> sparse =
2015-11-13 21:43:10 +03:00
> EOF
$ touch a b
$ cat > . hgsparse << EOF
> a
> EOF
$ hg commit - Aqm 'initial'
$ chmod a + x b
$ hg commit - qm 'make executable'
$ cat >> . hgsparse << EOF
> b
> EOF
$ hg commit - qm 'update profile'
$ hg up - q 0
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile . hgsparse
2015-11-13 21:43:10 +03:00
$ hg up - q 2
$ ls - l b
- rwxr - xr - x * b ( glob )
2017-11-10 17:39:11 +03:00
$ cd ..
Test profile discovery
$ hg init sparseprofiles
$ cd sparseprofiles
$ cat > . hg / hgrc << EOF
> [ extensions ]
2018-11-30 13:17:29 +03:00
> sparse =
2018-04-25 18:46:01 +03:00
> strip =
2018-04-18 20:31:30 +03:00
> [ hint ]
> ack - hint - ack = True
2017-11-10 17:39:11 +03:00
> EOF
2018-04-10 13:37:13 +03:00
$ mkdir - p profiles /foo profiles/ bar interesting
2017-11-10 17:39:11 +03:00
$ touch profiles / README . txt
2018-03-06 16:11:41 +03:00
$ touch profiles /foo/ README
2018-04-10 13:37:13 +03:00
$ dd if = /dev/ zero of = interesting /sizeable bs=4048 count=1024 2> / dev / null
2017-11-10 17:39:11 +03:00
$ cat > profiles /foo/s pam << EOF
> % include profiles /bar/ eggs
2018-03-14 16:49:45 +03:00
> [ metadata ]
> title: Profile that only includes another
2017-11-10 17:39:11 +03:00
> EOF
$ cat > profiles /bar/ eggs << EOF
2018-03-14 16:49:45 +03:00
> [ metadata ]
2018-05-01 00:04:18 +03:00
> title: Profile including the profiles directory
2018-03-14 16:49:45 +03:00
> description: This is a base profile , you really want to include this one
2018-03-26 18:44:48 +03:00
> if you want to be able to edit profiles . In addition , this profiles has
> some metadata .
> foo = bar baz and a whole
> lot more .
> team: me , myself and I
2017-11-10 17:39:11 +03:00
> [ include ]
> profiles
> EOF
2018-04-10 13:37:13 +03:00
$ cat > profiles /bar/ ham << EOF
> % include profiles /bar/ eggs
> [ metadata ]
> title: An extended profile including some interesting files
> [ include ]
> interesting
> EOF
2018-03-26 18:44:48 +03:00
$ cat > profiles /foo/mo nty << EOF
2018-03-29 12:34:06 +03:00
> [ metadata ]
> hidden: this profile is deliberatly hidden from listings
2018-03-26 18:44:48 +03:00
> [ include ]
> eric_idle
> john_cleese
> [ exclude ]
> guido_van_rossum
> EOF
2017-11-10 17:39:11 +03:00
$ touch profiles /bar/ python
2018-03-29 12:34:01 +03:00
$ mkdir hidden
$ cat > hidden / outsidesparseprofile << EOF
> A non - empty file to show that a sparse profile has an impact in terms of
> file count and bytesize .
> EOF
2018-04-10 13:37:13 +03:00
$ hg add - q profiles hidden interesting
$ hg commit - qm 'created profiles and some data'
2018-04-18 20:31:28 +03:00
$ hg sparse enableprofile profiles /foo/s pam
2018-03-23 00:34:29 +03:00
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
* profiles /foo/s pam Profile that only includes another
2018-03-23 00:34:29 +03:00
$ hg sparse list - T json
2017-11-10 17:39:11 +03:00
[
{
"active" : "included" ,
2018-05-01 00:04:18 +03:00
"metadata" : { "description" : "This is a base profile, you really want to include this one\nif you want to be able to edit profiles. In addition, this profiles has\nsome metadata." , "foo" : "bar baz and a whole\nlot more." , "team" : "me, myself and I" , "title" : "Profile including the profiles directory" } ,
2017-11-10 17:39:11 +03:00
"path" : "profiles/bar/eggs"
} ,
{
"active" : "active" ,
2018-03-14 16:49:45 +03:00
"metadata" : { "title" : "Profile that only includes another" } ,
2017-11-10 17:39:11 +03:00
"path" : "profiles/foo/spam"
}
]
$ cat >> . hg / hgrc << EOF
> [ sparse ]
> profile_directory = profiles /
2018-04-10 13:37:13 +03:00
> [ simplecache ]
> caches =
2017-11-10 17:39:11 +03:00
> EOF
2018-03-23 00:34:29 +03:00
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
* profiles /foo/s pam Profile that only includes another
2018-05-01 00:04:16 +03:00
hint [ sparse - list - verbose ] : 1 hidden profiles not shown ; add '--verbose' to include these
2018-03-23 00:34:29 +03:00
$ hg sparse list - T json
2017-11-10 17:39:11 +03:00
[
{
"active" : "included" ,
2018-05-01 00:04:18 +03:00
"metadata" : { "description" : "This is a base profile, you really want to include this one\nif you want to be able to edit profiles. In addition, this profiles has\nsome metadata." , "foo" : "bar baz and a whole\nlot more." , "team" : "me, myself and I" , "title" : "Profile including the profiles directory" } ,
2017-11-10 17:39:11 +03:00
"path" : "profiles/bar/eggs"
} ,
2018-04-10 13:37:13 +03:00
{
"active" : "inactive" ,
"metadata" : { "title" : "An extended profile including some interesting files" } ,
"path" : "profiles/bar/ham"
} ,
2017-11-10 17:39:11 +03:00
{
"active" : "inactive" ,
2018-03-14 16:49:45 +03:00
"metadata" : { } ,
2017-11-10 17:39:11 +03:00
"path" : "profiles/bar/python"
} ,
{
"active" : "active" ,
2018-03-14 16:49:45 +03:00
"metadata" : { "title" : "Profile that only includes another" } ,
2017-11-10 17:39:11 +03:00
"path" : "profiles/foo/spam"
}
]
2018-05-01 00:04:16 +03:00
hint [ sparse - list - verbose ] : 1 hidden profiles not shown ; add '--verbose' to include these
2018-10-19 16:49:04 +03:00
$ hg sparse show
Enabled Profiles:
* profiles /foo/s pam Profile that only includes another
~ profiles /bar/ eggs Profile including the profiles directory
$ hg sparse show - Tjson
[
{
"depth" : 0 ,
"name" : "profiles/foo/spam" ,
"title" : "Profile that only includes another" ,
"type" : "profile"
} ,
{
"depth" : 1 ,
"name" : "profiles/bar/eggs" ,
"title" : "Profile including the profiles directory" ,
"type" : "profile"
}
]
2017-11-10 17:39:11 +03:00
2018-03-20 18:22:48 +03:00
The current working directory plays no role in listing profiles:
$ mkdir otherdir
$ cd otherdir
2018-03-23 00:34:29 +03:00
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
* profiles /foo/s pam Profile that only includes another
2018-05-01 00:04:16 +03:00
hint [ sparse - list - verbose ] : 1 hidden profiles not shown ; add '--verbose' to include these
2018-03-20 18:22:48 +03:00
$ cd ..
2017-11-10 17:39:11 +03:00
Profiles are loaded from the manifest , so excluding a profile directory should
not hamper listing .
2018-04-18 20:31:28 +03:00
$ hg sparse exclude profiles / bar
2018-03-23 00:34:29 +03:00
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
* profiles /foo/s pam Profile that only includes another
2018-05-01 00:04:16 +03:00
hint [ sparse - list - verbose ] : 1 hidden profiles not shown ; add '--verbose' to include these
2018-10-19 16:49:04 +03:00
$ hg sparse show
Enabled Profiles:
* profiles /foo/s pam Profile that only includes another
~ profiles /bar/ eggs Profile including the profiles directory
Additional Excluded Paths:
profiles / bar
2018-03-29 12:34:06 +03:00
Hidden profiles only show up when we use the - - verbose switch:
$ hg sparse list - - verbose
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/mo nty
* profiles /foo/s pam Profile that only includes another
2018-05-01 00:04:16 +03:00
$ cat >> . hg / hgrc << EOF # enough hints now
> [ hint ]
> ack - sparse - list - verbose = true
> EOF
2018-03-14 16:49:45 +03:00
2018-05-01 00:04:15 +03:00
We can filter on fields being present or absent . This is how the - - verbose
switch is implemented . We can invert that test by filtering on the presence
of the hidden field:
$ hg sparse list - - with - field hidden
2018-10-19 16:49:04 +03:00
Available Profiles:
profiles /foo/mo nty
2018-05-01 00:04:15 +03:00
or we can filter on other fields , like missing description:
$ hg sparse list - - without - field description
2018-10-19 16:49:04 +03:00
Available Profiles:
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
* profiles /foo/s pam Profile that only includes another
2018-05-01 00:04:15 +03:00
multiple tests are cumulative , like a boolean AND operation ; both for exclusion
$ hg sparse list - - without - field description - - without - field title
2018-10-19 16:49:04 +03:00
Available Profiles:
profiles /bar/ python
2018-05-01 00:04:15 +03:00
and inclusion
$ hg sparse list - - with - field description - - with - field title
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
2018-05-01 00:04:15 +03:00
Naming the same field in without - and with - filters is an error:
$ hg sparse list - - with - field bar - - without - field bar
abort: You can ' t specify fields in both - - with - field and - - without - field , please use only one or the other , for bar
[ 255 ]
2018-05-04 17:28:34 +03:00
2018-05-01 00:04:18 +03:00
We can filter on the contents of a field or the path , case - insensitively:
$ hg sparse list - - filter path: /bar/ - - filter title:profile
2018-10-19 16:49:04 +03:00
Available Profiles:
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
2018-05-01 00:04:15 +03:00
2018-05-04 17:28:34 +03:00
We can filter on specific files being included in a sparse profile:
$ hg sparse list - - contains - file interesting / sizeable
2018-10-19 16:49:04 +03:00
Available Profiles:
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
2018-05-04 17:28:34 +03:00
2018-04-25 18:46:01 +03:00
You can specify a revision to list profiles for ; in this case the current
sparse configuration is ignored ; no profile can be 'active' or 'included' :
$ cat > profiles /foo/ new_in_later_revision << EOF
> [ metadata ]
> title: this profile is only available in a later revision , not the current .
> EOF
$ hg commit - Aqm 'Add another profile in a later revision'
$ hg up - r ".^"
0 files updated , 0 files merged , 1 files removed , 0 files unresolved
$ hg sparse list - r tip
2018-10-19 16:49:04 +03:00
Available Profiles:
profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ new_in_later_revision this profile is only available in a later revision , not the current .
profiles /foo/s pam Profile that only includes another
2018-04-25 18:46:01 +03:00
$ hg - q strip - r tip - - no - backup
2018-03-14 16:49:45 +03:00
The metadata section format can have errors , but those are only listed as
warnings:
$ cat > profiles /foo/ errors << EOF
> [ metadata ]
> indented line but no current key active
> not an option line , there is no delimiter
> EOF
$ hg add - q profiles
$ hg commit - qm 'Broken profile added'
2018-03-23 00:34:29 +03:00
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
2018-03-14 16:49:45 +03:00
warning: sparse profile [ metadata ] section indented lines that do not belong to a multi - line entry , ignoring , in profiles /foo/ errors:2
warning: sparse profile [ metadata ] section does not appear to have a valid option definition , ignoring , in profiles /foo/ errors:3
2018-10-19 16:49:04 +03:00
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ errors
* profiles /foo/s pam Profile that only includes another
2018-03-14 16:49:45 +03:00
2018-04-24 19:43:06 +03:00
The . hg / sparse file could list non - existing profiles , these should be ignored
when listing:
$ hg sparse enableprofile nonesuch
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
2018-04-24 19:43:06 +03:00
warning: sparse profile [ metadata ] section indented lines that do not belong to a multi - line entry , ignoring , in profiles /foo/ errors:2
warning: sparse profile [ metadata ] section does not appear to have a valid option definition , ignoring , in profiles /foo/ errors:3
2018-10-19 16:49:04 +03:00
~ profiles /bar/ eggs Profile including the profiles directory
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ errors
* profiles /foo/s pam Profile that only includes another
2018-04-24 19:43:06 +03:00
$ hg sparse disableprofile nonesuch
2018-10-02 13:29:00 +03:00
Can switch between profiles
$ test - f interesting / sizeable
[ 1 ]
$ hg sparse switchprofile profiles /bar/ ham
$ hg sparse list
2018-10-19 16:49:04 +03:00
Available Profiles:
2018-10-02 13:29:00 +03:00
warning: sparse profile [ metadata ] section indented lines that do not belong to a multi - line entry , ignoring , in profiles /foo/ errors:2
warning: sparse profile [ metadata ] section does not appear to have a valid option definition , ignoring , in profiles /foo/ errors:3
2018-10-19 16:49:04 +03:00
~ profiles /bar/ eggs Profile including the profiles directory
* profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ errors
profiles /foo/s pam Profile that only includes another
2018-10-02 13:29:00 +03:00
$ test - f interesting / sizeable
2018-03-26 18:44:48 +03:00
We can look at invididual profiles:
$ hg sparse explain profiles /bar/ eggs
profiles /bar/ eggs
2018-05-01 00:04:18 +03:00
Profile including the profiles directory
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
2018-03-26 18:44:48 +03:00
This is a base profile , you really want to include this one if you want to be
able to edit profiles . In addition , this profiles has some metadata .
2018-03-29 12:34:01 +03:00
Size impact compared to a full checkout
=== === === === === === === === === === === === ===
2018-04-10 13:37:13 +03:00
file count 8 ( 80.00 % )
2018-03-29 12:34:01 +03:00
2018-03-26 18:44:48 +03:00
Additional metadata
=== === === === === === =
foo bar baz and a whole lot more .
team me , myself and I
Inclusion rules
=== === === === ===
profiles
2018-04-18 20:31:30 +03:00
hint [ sparse - explain - verbose ] : use 'hg sparse explain --verbose profiles/bar/eggs' to include the total file size for a give profile
2018-03-26 18:44:48 +03:00
2018-04-10 13:37:13 +03:00
$ hg sparse explain profiles /bar/ ham - T json
2018-03-26 18:44:48 +03:00
[
{
"excludes" : [] ,
2018-04-10 13:37:14 +03:00
"includes" : [ "interesting" ] ,
2018-04-10 13:37:13 +03:00
"metadata" : { "title" : "An extended profile including some interesting files" } ,
"path" : "profiles/bar/ham" ,
2018-04-10 13:37:14 +03:00
"profiles" : [ "profiles/bar/eggs" ] ,
2018-04-10 13:37:13 +03:00
"stats" : { "filecount" : 9 , "filecountpercentage" : 90.0 }
2018-03-29 12:34:01 +03:00
}
]
2018-04-18 20:31:30 +03:00
hint [ sparse - explain - verbose ] : use 'hg sparse explain --verbose profiles/bar/ham' to include the total file size for a give profile
2018-04-10 13:37:13 +03:00
$ hg sparse explain profiles /bar/ ham - T json - - verbose
2018-03-29 12:34:01 +03:00
[
{
"excludes" : [] ,
2018-04-10 13:37:14 +03:00
"includes" : [ "interesting" ] ,
2018-04-10 13:37:13 +03:00
"metadata" : { "title" : "An extended profile including some interesting files" } ,
"path" : "profiles/bar/ham" ,
2018-04-10 13:37:14 +03:00
"profiles" : [ "profiles/bar/eggs" ] ,
2018-05-01 00:04:18 +03:00
"stats" : { "filecount" : 9 , "filecountpercentage" : 90.0 , "totalsize" : 4145875 }
2018-03-26 18:44:48 +03:00
}
]
2018-04-18 20:31:30 +03:00
$ cat >> . hg / hgrc << EOF # enough hints now
> [ hint ]
> ack - sparse - explain - verbose = true
> EOF
2018-03-26 18:44:48 +03:00
$ hg sparse explain profiles /bar/ eggs
profiles /bar/ eggs
2018-05-01 00:04:18 +03:00
Profile including the profiles directory
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
2018-03-26 18:44:48 +03:00
This is a base profile , you really want to include this one if you want to be
able to edit profiles . In addition , this profiles has some metadata .
2018-03-29 12:34:01 +03:00
Size impact compared to a full checkout
=== === === === === === === === === === === === ===
2018-04-10 13:37:13 +03:00
file count 8 ( 80.00 % )
2018-03-29 12:34:01 +03:00
2018-03-26 18:44:48 +03:00
Additional metadata
=== === === === === === =
foo bar baz and a whole lot more .
team me , myself and I
Inclusion rules
=== === === === ===
2018-03-29 12:34:01 +03:00
profiles
$ hg sparse explain profiles /bar/ eggs - - verbose
profiles /bar/ eggs
2018-05-01 00:04:18 +03:00
Profile including the profiles directory
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
2018-03-29 12:34:01 +03:00
This is a base profile , you really want to include this one if you want to be
able to edit profiles . In addition , this profiles has some metadata .
Size impact compared to a full checkout
=== === === === === === === === === === === === ===
2018-04-10 13:37:13 +03:00
file count 8 ( 80.00 % )
2018-05-01 00:04:18 +03:00
total size 723 bytes
2018-03-29 12:34:01 +03:00
Additional metadata
=== === === === === === =
foo bar baz and a whole lot more .
team me , myself and I
Inclusion rules
=== === === === ===
2018-03-26 18:44:48 +03:00
profiles
2018-04-10 13:37:13 +03:00
$ hg sparse explain profiles /bar/ eggs profiles /bar/ ham profiles / nonsuch - - verbose
2018-03-29 12:34:01 +03:00
The profile profiles / nonsuch was not found
2018-03-26 18:44:48 +03:00
profiles /bar/ eggs
2018-05-01 00:04:18 +03:00
Profile including the profiles directory
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
2018-03-26 18:44:48 +03:00
This is a base profile , you really want to include this one if you want to be
able to edit profiles . In addition , this profiles has some metadata .
2018-03-29 12:34:01 +03:00
Size impact compared to a full checkout
=== === === === === === === === === === === === ===
2018-04-10 13:37:13 +03:00
file count 8 ( 80.00 % )
2018-05-01 00:04:18 +03:00
total size 723 bytes
2018-03-29 12:34:01 +03:00
2018-03-26 18:44:48 +03:00
Additional metadata
=== === === === === === =
foo bar baz and a whole lot more .
team me , myself and I
Inclusion rules
=== === === === ===
profiles
2018-04-10 13:37:13 +03:00
profiles /bar/ ham
2018-03-26 18:44:48 +03:00
2018-04-10 13:37:13 +03:00
An extended profile including some interesting files
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
2018-03-26 18:44:48 +03:00
2018-03-29 12:34:01 +03:00
Size impact compared to a full checkout
=== === === === === === === === === === === === ===
2018-04-10 13:37:13 +03:00
file count 9 ( 90.00 % )
total size 3.95 MB
2018-03-29 12:34:06 +03:00
2018-04-10 13:37:14 +03:00
Profiles included
=== === === === === ==
profiles /bar/ eggs
2018-03-26 18:44:48 +03:00
Inclusion rules
=== === === === ===
2018-04-10 13:37:13 +03:00
interesting
2018-03-26 18:44:48 +03:00
2018-03-29 12:34:01 +03:00
$ hg sparse explain profiles /bar/ eggs - T "{path}\n{metadata.title}\n{stats.filecount}\n"
2018-03-26 18:44:48 +03:00
profiles /bar/ eggs
2018-05-01 00:04:18 +03:00
Profile including the profiles directory
2018-04-10 13:37:13 +03:00
8
2018-03-29 12:34:02 +03:00
2018-04-10 13:37:19 +03:00
The - r switch tells hg sparse explain to look at something other than the
current working copy:
$ hg sparse reset
$ touch interesting / later_revision
$ hg commit - Aqm 'Add another file in a later revision'
$ hg sparse explain profiles /bar/ ham - T "{stats.filecount}\n" - r ".^"
9
$ hg sparse explain profiles /bar/ ham - T "{stats.filecount}\n" - r .
10
2018-05-04 17:28:34 +03:00
$ hg sparse list - - contains - file interesting / later_revision - r ".^"
2018-10-19 16:49:04 +03:00
Available Profiles:
2018-05-04 17:28:34 +03:00
warning: sparse profile [ metadata ] section indented lines that do not belong to a multi - line entry , ignoring , in profiles /foo/ errors:2
warning: sparse profile [ metadata ] section does not appear to have a valid option definition , ignoring , in profiles /foo/ errors:3
2018-10-19 16:49:04 +03:00
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ errors
2018-05-04 17:28:34 +03:00
$ hg sparse list - - contains - file interesting / later_revision - r .
2018-10-19 16:49:04 +03:00
Available Profiles:
2018-05-04 17:28:34 +03:00
warning: sparse profile [ metadata ] section indented lines that do not belong to a multi - line entry , ignoring , in profiles /foo/ errors:2
warning: sparse profile [ metadata ] section does not appear to have a valid option definition , ignoring , in profiles /foo/ errors:3
2018-10-19 16:49:04 +03:00
profiles /bar/ ham An extended profile including some interesting files
profiles /bar/ python
profiles /foo/ errors
2018-04-10 13:37:19 +03:00
$ hg up - q ".^"
2018-03-29 12:34:02 +03:00
We can list the files in a profile with the hg sparse files command:
$ hg sparse files profiles /bar/ eggs
profiles / README . txt
profiles /bar/ eggs
2018-04-10 13:37:13 +03:00
profiles /bar/ ham
2018-03-29 12:34:02 +03:00
profiles /bar/ python
profiles /foo/ README
profiles /foo/ errors
profiles /foo/mo nty
profiles /foo/s pam
$ hg sparse files profiles /bar/ eggs ** /README **/ README . *
profiles / README . txt
profiles /foo/ README
2018-04-10 13:37:13 +03:00
Files for included profiles are taken along:
$ hg sparse files profiles /bar/ ham | wc - l
\ s * 9 ( re )
File count and size data for hg explain is cached in the simplecache extension:
$ cat >> . hg / hgrc << EOF
> [ simplecache ]
> caches = local
> cachedir = $ TESTTMP / cache
> EOF
$ hg sparse explain profiles /bar/ eggs profiles /bar/ ham > /dev/ null
$ ls - 1 $ TESTTMP / cache
2018-05-01 00:04:18 +03:00
sparseprofile:profiles__bar__eggs:07b307002dae98240fe64a42df9598263f69d925:v1
sparseprofile:profiles__bar__ham:07b307002dae98240fe64a42df9598263f69d925:v1
sparseprofilestats:sparseprofiles:profiles__bar__eggs:ab56132ffe9320163b73f769a0a32d84c6869949:0:07b307002dae98240fe64a42df9598263f69d925:False:v1
sparseprofilestats:sparseprofiles:profiles__bar__ham:07b4880e6fcb1f6b13998b0c6bc47f256a0f6d33:0:07b307002dae98240fe64a42df9598263f69d925:False:v1
sparseprofilestats:sparseprofiles:unfiltered:07b307002dae98240fe64a42df9598263f69d925:v1