Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mercurial-path_pattern
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-path_pattern
Commits
1697ee689381
Commit
1697ee689381
authored
8 years ago
by
Marcin Kasperski
Browse files
Options
Downloads
Patches
Plain Diff
A few docfixes
parent
93a1b8620610
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.txt
+15
-14
15 additions, 14 deletions
README.txt
mercurial_path_pattern.py
+360
-360
360 additions, 360 deletions
mercurial_path_pattern.py
with
375 additions
and
374 deletions
README.txt
+
15
−
14
View file @
1697ee68
...
...
@@ -77,7 +77,7 @@
By default path patterns have lower priority than per-repository
paths, so in case you define ``lagrange`` path on repository level, it
won't be overwritten by pattern. You can augment it by adding
won't be overwritten by
the
pattern. You can augment it by adding
``.enforce``::
[path_pattern]
...
...
@@ -87,7 +87,7 @@
With such config pattern wins against any path from ``.hg/hgrc``
(usually it is not recommended but can be handy if you have some
broken path
s
scattered around repositories).
broken path scattered around repositories).
Reusing the same alias
--------------------------------------------------------
...
...
@@ -130,8 +130,8 @@
hg init xyz
cd xyz
hg cloneto lagrange
# Works, creates soures/libs/xyz on johny@lagrange.mekk.net
# Works, creates sour
c
es/libs/xyz on johny@lagrange.mekk.net
.. note::
While ``cloneto`` is particularly useful with patterns, it works
...
...
@@ -134,8 +134,8 @@
.. note::
While ``cloneto`` is particularly useful with patterns, it works
for usual paths as well. You can write (new) path to repository
for usual paths as well. You can write (new) path to repository
-level
``.hg/hgrc``, then ``hg cloneto «new-name»``.
Instead of ``clonefrom``
...
...
@@ -216,8 +216,8 @@
.. note::
First matching pattern is used if more than one matches. Picking
*best* pattern may be implemented in the future
.
In case multiple patterns of the same name match, extension tries
to find *best* one. See `Pattern priority`_ chapter below
.
The ``.local`` part should specify absolute repository path (``~`` and
``~user`` are allowed). Some part(s) of the path may be replaced with
...
...
@@ -240,7 +240,7 @@
Markers are optional, if no marker is used (see ``official`` above),
rule applies to exactly one repository. This may make sense (over
defining path in given repo ``.hg/hgrc``) if you prefer to centralize
your
paths
.
your
remote paths management
.
The ``.remote`` part defines appropriate remote address. This is typical
Mercurial remote path, but ``{marker}``'s can be used to refer to
...
...
@@ -251,4 +251,5 @@
was extracted as* ``sth`` *and replace any* ``x`` *with* ``y``. This is
mostly used to replace ``/`` with some other character (in particular
``{below:/=-}`` handles BitBucket convention, replacing slashes with minuses).
Replacements can be multi-letter, for example ``{sth:com=net}``.
...
...
@@ -254,5 +255,5 @@
Replacements can be chained if necessary – ``{sth:x=y
,
v=z}`` means
Replacements can be chained if necessary – ``{sth:x=y
:
v=z}`` means
*take whatever was extracted as* ``sth``, *replace any* ``x`` *with*
``y``, *then replace any* ``v`` *with* ``z``, *then use the final
result*.
...
...
@@ -267,7 +268,7 @@
``python/libs/webby``. Filling ``lagrange.remote`` with
that value generates
``ssh://johny@lagrange.mekk.net/sources/python/libs/webby``, so
finally it will create path alias
the following path alias is created:
``lagrange=ssh://johny@lagrange.mekk.net/sources/python/libs/webby``
2. Discover that ``euler.local`` also matches, and ``{repo}`` is again
...
...
@@ -283,7 +284,7 @@
defining anything), extract matching path from
``official.thg.remote``, and finally generate for this repository
path ``official = https://bitbucket.org/tortoisehg/thg`` (so ``hg
pull official`` works there). Note that the path is just
pull official`` works there). Note that the path
alias
is just
``official``, the ``.thg.`` part was used only to group appropriate
config items.
...
...
@@ -287,7 +288,7 @@
``official``, the ``.thg.`` part was used only to group appropriate
config items.
2. Ignore remaining patters which do not match.
2. Ignore remaining patter
n
s which do not match.
Legacy syntax
...
...
@@ -323,7 +324,7 @@
.. note::
I keep supporting ``.alias`` syntax for backward compatibility (it
was the
first
syntax provided for the task) but it is more
was the
initial
syntax provided for the task) but it is more
elaborate and less readable, so I don't recommend it anymore.
...
...
@@ -368,7 +369,7 @@
``~/(klass)/libs/base`` with ``~/src/{repo}``). Current
implementation looks for the length of non-varying prefix (so the
latter will win over the former as ``~/src/`` is longer than
``~/``). If th
at is equal
, pattern with more non-var characters wins,
``~/``). If th
ose are of equal length
, pattern with more non-var characters wins,
and finally, the one which happened last in the config file.
Some details may change in the future, use ``enforce`` when in
...
...
@@ -372,7 +373,7 @@
and finally, the one which happened last in the config file.
Some details may change in the future, use ``enforce`` when in
doubt.
doubt
(or let me know if numeric priority would be useful)
.
...
...
This diff is collapsed.
Click to expand it.
mercurial_path_pattern.py
+
360
−
360
View file @
1697ee68
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment