hgext/purge.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 09 Apr 2024 22:37:15 +0200
changeset 51595 3a6fae3bef35
parent 47642 0caac68a5c3c
permissions -rw-r--r--
outgoing: add a simple fastpath when there is no common This further speed up case like `hg bundle --all` for larger repository. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 before: 316.749699 after: 311.165461 (-1.76%, -5.58) There is further work to be done in this area like not doing any outgoing computation in the stream case for example. however the recent changes already gives use a large win for a small amount of local work. ### benchmark.name = hg.command.bundle # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.revs = all # benchmark.variants.type = none-streamv2 ## data-env-vars.name = mercurial-public-2024-03-22-zstd-sparse-revlog pre-%ln-change: 1.263859 the-%ln-change: 0.700229 (-44.60%, -0.56) prev-changeset: 0.496050 (-60.75%, -0.77) this-changeset: 0.495243 (-60.81%, -0.77) ## data-env-vars.name = tryton-public-2024-03-22-zstd-sparse-revlog pre-%ln-change: 2.975765 the-%ln-change: 1.870798 (-37.13%, -1.10) prev-changeset: 1.461583 (-50.88%, -1.51) this-changeset: 1.469185 (-50.63%, -1.51) ## data-env-vars.name = pypy-2024-03-22-zstd-sparse-revlog pre-%ln-change: 4.540080 the-%ln-change: 3.401700 (-25.07%, -1.14) prev-changeset: 2.915810 (-35.78%, -1.62) this-changeset: 2.911643 (-35.87%, -1.63) ## data-env-vars.name = heptapod-public-2024-03-25-zstd-sparse-revlog pre-%ln-change: 10.138396 the-%ln-change: 7.750458 (-23.55%, -2.39) prev-changeset: 6.665565 (-34.25%, -3.47) this-changeset: 6.672078 (-34.19%, -3.47) ## data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog pre-%ln-change: 399.484481 the-%ln-change: 346.508952 (-13.26%, -52.98) prev-changeset: 316.749699 (-20.71%, -82.73) this-changeset: 311.165461 (-22.11%, -88.32)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     1
# Copyright (C) 2006 - Marco Barisione <marco@barisione.org>
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     2
#
26421
4b0fc75f9403 urls: bulk-change primary website URLs
Matt Mackall <mpm@selenic.com>
parents: 25186
diff changeset
     3
# This is a small extension for Mercurial (https://mercurial-scm.org/)
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     4
# that removes files not known to mercurial
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
     5
#
9270
00cc7fa0c0c6 purge: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9215
diff changeset
     6
# This program was inspired by the "cvspurge" script contained in CVS
00cc7fa0c0c6 purge: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9215
diff changeset
     7
# utilities (http://www.red-bean.com/cvsutils/).
4154
15cd36db4230 Delete the README for purge, putting the useful informations in comments
Emanuele Aina <em@nerd.ocracy.org>
parents: 4153
diff changeset
     8
#
15cd36db4230 Delete the README for purge, putting the useful informations in comments
Emanuele Aina <em@nerd.ocracy.org>
parents: 4153
diff changeset
     9
# For help on the usage of "hg purge" use:
15cd36db4230 Delete the README for purge, putting the useful informations in comments
Emanuele Aina <em@nerd.ocracy.org>
parents: 4153
diff changeset
    10
#  hg help purge
15cd36db4230 Delete the README for purge, putting the useful informations in comments
Emanuele Aina <em@nerd.ocracy.org>
parents: 4153
diff changeset
    11
#
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    12
# This program is free software; you can redistribute it and/or modify
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    13
# it under the terms of the GNU General Public License as published by
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    14
# the Free Software Foundation; either version 2 of the License, or
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    15
# (at your option) any later version.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    16
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    17
# This program is distributed in the hope that it will be useful,
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    20
# GNU General Public License for more details.
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    21
#
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    22
# You should have received a copy of the GNU General Public License
15782
7de7630053cb Remove FSF mailing address from GPL headers
Martin Geisler <mg@aragost.com>
parents: 14671
diff changeset
    23
# along with this program; if not, see <http://www.gnu.org/licenses/>.
2364
f368a1c302d5 Initial commit
demian@gaudron.lan
parents:
diff changeset
    24
46368
bb3a5c0df06b purge: move extension into core mercurial
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 46366
diff changeset
    25
'''command to delete untracked files from the working directory (DEPRECATED)
9215
f6a880fa9cd7 purge: fix formatting of lists with proper reST markup
Martin Geisler <mg@lazybytes.net>
parents: 9072
diff changeset
    26
46368
bb3a5c0df06b purge: move extension into core mercurial
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 46366
diff changeset
    27
The functionality of this extension has been included in core Mercurial since
47642
0caac68a5c3c doc: wrap the help text for the purge extension
Matt Harbison <matt_harbison@yahoo.com>
parents: 47462
diff changeset
    28
version 5.7. Please use :hg:`purge ...` instead. :hg:`purge --confirm` is now
0caac68a5c3c doc: wrap the help text for the purge extension
Matt Harbison <matt_harbison@yahoo.com>
parents: 47462
diff changeset
    29
the default, unless the extension is enabled for backward compatibility.
46368
bb3a5c0df06b purge: move extension into core mercurial
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 46366
diff changeset
    30
'''
39463
7fea205fd5dc merge: move purge logic from extension
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36571
diff changeset
    31
46368
bb3a5c0df06b purge: move extension into core mercurial
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 46366
diff changeset
    32
# This empty extension looks pointless, but core mercurial checks if it's loaded
bb3a5c0df06b purge: move extension into core mercurial
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 46366
diff changeset
    33
# to implement the slightly different behavior documented above.
47462
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    34
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    35
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    36
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    37
# be specifying the version(s) of Mercurial they are tested with, or
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    38
# leave the attribute unspecified.
75d4e60c7c81 purge: restore the `testedwith` declaration
Matt Harbison <matt_harbison@yahoo.com>
parents: 46368
diff changeset
    39
testedwith = b'ships-with-hg-core'