Commit Graph

3772 Commits

Author SHA1 Message Date
Pierre-Yves David
a1ed29a5c8 histedit: rename tip to topmost
I expected `tip` to be repo's tip when it was the rewritten set tip. I rename
the variable to the less ambiguous `topmost`.
2012-09-26 18:13:00 +02:00
Pierre-Yves David
b30bd4fe4d histedit: factorise node stripping logic
Create a function dedicated to stripping a group of node. All existing
duplicated code is replaced by call to this function.

This new function take care of stripping known and relevant node only.
2012-09-26 14:46:08 +02:00
Pierre-Yves David
650044fefe histedit: extract bookmark logic in a dedicated function
This lighten the main function and will help to see future changes to this
bookmark logic.
2012-09-26 14:19:19 +02:00
Pierre-Yves David
9b26a9a8ee histedit: remove all usages of hex[:12]
- `node.hex(n)[:12]` is the same as `node.short(n)`
- `ctx.hex()[:12]` is the same as `str(ctx)`
2012-09-26 12:57:23 +02:00
Matt Mackall
8c86a57e7c merge with stable 2012-09-27 15:51:14 -05:00
Pierre-Yves David
7053ba6e9e histedit: replaces patching logic by merges
The old and fragile patching logic is replaced by smart merges (as rebase and
graft do). This should prevents some conflicts and smoother human resolution.

For this purpose the "foldchanges" function is renamed to "applychanges" and
handle a single revision only.
2012-09-21 19:27:22 +02:00
Pierre-Yves David
f9a739a15f histedit: display action being processed in debug mode
This is very useful when debugging histedit.
2012-09-21 19:25:19 +02:00
Pierre-Yves David
56df9607c6 histedit: fold in memory
Update the folding code to works in memory instead of applying patches on the
working directory. This is cleaner, faster and prepare the removal of the whole
patching logic.

This new collapse function will probably move into core sooner or later. A lot
of other rewriting operation may benefit from it.
2012-09-21 19:24:31 +02:00
Pierre-Yves David
c8363dbc19 histedit: move makedesc function near other rules related function
Having it in the middle of action logic is confusing
2012-09-21 00:33:30 +02:00
Pierre-Yves David
94277b3144 histedit: move between function outside the action logic
Having this function in the middle of action and patching logic did not make
sense
2012-09-21 19:14:04 +02:00
Pierre-Yves David
cb6a116fe7 histedit document the makedest function 2012-09-21 00:30:22 +02:00
Pierre-Yves David
603772df2b histedit: documents the between function 2012-09-21 00:30:07 +02:00
Bryan O'Sullivan
ed33f34e0c Merge with mpm 2012-09-18 16:30:21 -07:00
Pierre-Yves David
7a06ce262e rebase: ensure rebase does not revive extinct revision
Here, we exclude hidden changesets from a rebase operation. If we
don't, a rewritten version of the hidden changesets will be created
by rebase. Those rewritten versions won't be hidden and will likely
conflict with other rewriting or revive pruned changeset. Moreover,
rewriting hidden revisions will surprise the user.

This change would not be necessary if changelog filtering were
already in core. But it's fairly cheap and helps to increase the
test-suite for such filtering.

Once changelog level filtering is added, hidden changes will be
automatically excluded or included according to the global --hidden
flags. Plain ignoring them is good enough for now.
2012-09-18 23:32:42 +02:00
Pierre-Yves David
6fa51bbd6d rebase: remove useless list around repo.revs
As repo.revs already returns a list.
2012-09-18 23:29:05 +02:00
Pierre-Yves David
4e2a2d8f61 rebase: properly handle --collapse when creating obsolescence marker
In collapse mode, that content of state is not suitable to compute obsolescence
markers. We explicitly pass the resulting revision instead and use it as the
successors for all elements of the rebased set.
2012-09-18 23:42:27 +02:00
Matt Mackall
77a75fbd07 merge with stable 2012-09-18 16:19:56 -05:00
Pierre-Yves David
be6378e49d rebase: allow creation obsolescence relation instead of stripping
When obsolescence feature is enabled we now create markers from the rebased
set to the resulting set instead of stripping. The "state" mapping built by
rebase holds all necessary data.

Changesets "deleted" by the rebase are marked "succeeded" by the changeset they
would be rebased one. That the best guess of "successors" we have. Getting a
successors as meaningful as possible is important for automatic resolution of
obsolescence troubles. In other word, emptied changeset will looks collapsed
with their former parents. (see "empty changeset" section of the test if you are
still confused)
2012-09-18 23:13:31 +02:00
Pierre-Yves David
f0bddab386 rebase: extract final changesets cleanup logic in a dedicated function
At the end of the rebase, rebased changesets are currently stripped. This
behavior will be eventually dropped in favor of obsolescence marker creation.

The main rebase function is already big and branchy enough. This changeset move
the clean-up logic in a dedicated function before we make it more complex.
2012-09-18 22:58:12 +02:00
Matt Mackall
b0dd832e65 merge with stable 2012-09-17 15:13:17 -05:00
Nikolaj Sjujskij
88edfbe265 record: fix display of non-ASCII names in chunk selection
46cdcb89086f fixed display of non-ASCII names in file-selecting prompt, but
display in chunk selection remained broken. The reason is that using '%r' in
string formatting results in calling `repr` on file names, thus mangling
non-ASCII ones.
2012-09-15 00:06:08 +04:00
Matt Harbison
fa8ea6e5a3 largefiles: delegate to the wrapped clone command
This allows the wrapped command's validation code to run (which is currently
only to ensure 'noupdate' and 'updaterev' aren't both specified), the
copy/pasted unpacking of hg.clone() args to be removed, and any future changes
to the base command (however unlikely) to be inherited by largefiles.

Unfortunately, the command override can't be swapped entirely for an hg.clone()
override because the extra --all-largefiles arg needs to be injected.  It also
isn't enough to call the wrapped clone command and leave the caching code after
it, because the file caching code needs access to the destination repo, which is
only available from hg.clone().  An alternative would be to use the dest path in
the clone command override to re-obtain a reference to the repo.

A slight deviation from the regular hg.clone() function is that the repo is NOT
deleted if the caching fails, but that was also the previous behavior.  Maybe it
should for consistency?
2012-09-09 12:43:24 -04:00
Matt Harbison
b14b475d95 largefiles: don't convert dest=None to dest=hg.defaultdest() in clone command
A status message is output if hg.clone() determines the default destination
because None was provided.  The previous code never passed None to hg.clone().
2012-09-09 12:09:53 -04:00
Matt Harbison
93f873fbd2 largefiles: restore caching of largefiles with 'clone -U --all-largefiles'
This was broken when restoring normal -u and -U functionality.
2012-09-09 03:37:38 -04:00
Matt Harbison
3eb1617064 largefiles: restore normal 'clone -u' and 'clone -U' functionality
Previously, tip would be checked out regardless of the -u or -U parameter.  I'm
not sure what the 'required for successful walkchangerevs' comment meant, but it
appears to reference code which has since moved to downloadlfiles() in
5c06bddf85b8.  Perhaps it was to force caching when the -U parameter is given?
The price of this change is that -U --all-largefiles won't cache anything.  That
will be fixed next.

Note that X + Y in the 'X largefiles updated, n removed' and 'Y additional
largefiles cached' lines do not add up to the same values in these tests, but
all of the largefiles have been downloaded.  The reason being that several
largefiles have the same content (eb7338044 is pointed to by sub/large2, large3
and sub/large4).  In the 'clone -u 1' operation, this largefile is cached to
populate the working directory, even without --all-largefiles.  That means the
file isn't downloaded again and cached in the rev where large3 and sub/large4
both point to this file.  Downloading that one file in that one rev seems to be
counted twice with 'clone -u 0'.  (Maybe it is also being downloaded twice?)
2012-09-08 13:31:06 -04:00
Matt Harbison
d3a4f5a08b largefiles: preserve the exit status of the forget command
This maintains the exit codes documented in commands.py.
2012-09-05 22:42:23 -04:00
Matt Harbison
0931dc58e6 largefiles: preserve the exit status of the rebase command 2012-09-05 22:31:03 -04:00
Matt Harbison
ac0da61364 largefiles: preserve the exit status of the log command 2012-09-05 22:12:40 -04:00
Matt Harbison
4cda36b611 largefiles: exit from remove with 1 on warnings
This maintains the exit codes documented in commands.py.
2012-09-09 20:18:08 -04:00
Matt Harbison
096f56ab20 largefiles: preserve exit code from outgoing command (issue3611)
This maintains the exit codes documented in commands.py.
2012-09-05 21:26:08 -04:00
Patrick Mezard
e64291c725 convert: use subprocess for all commandline calls
Avoid mixing popen and subprocess calls, it simplifies the command line
generation and quoting issues with redirections.

In practice, it fixes the subversion sink on Windows and probably helps
with monotone and darcs sources.
2012-08-03 21:37:33 +02:00
Patrick Mezard
2a34f7fc18 convert: make commandline.limit_arglist private, simplify 2012-08-03 21:05:01 +02:00
Matt Harbison
2128536df5 largefiles: adjust localstore to handle batch statlfile requests (issue3583)
This fixes a traceback when pushing to a local repo which started with
6fb54510b150.
2012-08-14 22:38:25 -04:00
Ross Lagerwall
661779d660 util: replace util.nulldev with os.devnull
Python since 2.4 has supported os.devnull so having util.nulldev
is unnecessary.
2012-08-04 07:14:40 +02:00
Matt Mackall
b2cf3ac691 merge with i18n 2012-08-06 12:03:07 -05:00
Wagner Bruna
d09c1ff6cb histedit, i18n: warn translators about edit command names 2012-08-02 11:45:16 -03:00
Wagner Bruna
1d9183c516 histedit: sync docstring with edit comment
The docstring should probably reuse the edit comment string instead.
2012-08-02 11:28:21 -03:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
Patrick Mezard
c54ad25151 histedit: fix unused variable warnings spotted by pyflakes 2012-09-05 22:01:09 +02:00
timeless@mozdev.org
49f2d80b82 en-us: recognized 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
345b9606c8 en-us: Initialize 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
2c6bc1f9fe spelling: update 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
dbc876a6d7 spelling: successfully 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
75fe27e277 spelling: shouldn't 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
1dcf931117 spelling: responsibility 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
f659dfb743 spelling: precede 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
8d25b9561a spelling: Macintosh 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
5cab7e44e1 spelling: further 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
5e8f508211 spelling: don't/do not 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
20be43e2d8 spelling: directly 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
0dc2f07fe8 spelling: dependent 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
d67a2c0727 spelling: Failing 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
2a09dc2301 spelling: Explicitly 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
b9a05ebe82 spelling: Authoritative 2012-08-17 13:58:18 -07:00
Sumeet
de52249a43 record: checks for valid username before starting recording process (issue3456) 2012-08-27 12:41:10 -07:00
Bryan O'Sullivan
68bb78ae36 Merge with crew-stable 2012-09-04 13:50:50 -07:00
Bryan O'Sullivan
83bb6c80ab Merge 2012-09-04 13:49:10 -07:00
Mads Kiilerich
7af1f60b20 largefiles: minor code cleanup
Fix:
* unnecessary use of map and lambda
* comment instead of readable code
* comparing None with 0
* and...or anti-pattern for 'ternary if' with very clever handling of i=None
2012-08-27 23:17:21 +02:00
Mads Kiilerich
5e3dc3e383 avoid using abbreviations that look like spelling errors 2012-08-27 23:14:27 +02:00
Leah Xue
b766bced84 histedit: factored out diff/patch logic
This patch is the first step towards a refactoring of the histedit
extension to use underlying graft machinery instead of diff/patch as
discussed in issue3527. Replacing diff/patch with graft is necessary
to fix, for example, issue3582.
2012-08-21 16:06:34 -07:00
Mads Kiilerich
520076e707 delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
Mads Kiilerich
2372d51b68 fix wording and not-completely-trivial spelling errors and bad docstrings 2012-08-15 22:39:18 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Augie Fackler
124780aa68 histedit: add proper locking around repair.strip() calls 2012-08-01 09:41:57 -05:00
Patrick Mezard
7584dc0071 rebase: remove second broken synopsis line (issue3172)
Displaying multiple synopsis in online help has been broken since Matt
RST refactoring, around 54e90eb99cfa. Rebase help is apparently the only
one using this trick, just drop the second synopsis and assume people
will understand as with graft help.
2012-07-31 18:18:26 +02:00
Matt Harbison
fd44bab84b largefiles: enable islfilesrepo() prior to a commit (issue3541)
Previously, even if a file was added with --large, 'hg addremove' or 'hg ci -A'
would add all files (including the previously added large files) as normal
files.  Only after a commit where a file was added with --large would subsequent
adds or 'ci -A' take into account the minsize or the pattern configuration.
This change more closely follows the help for largefiles, which mentions that
'add --large' is required to enable the configuration, but doesn't mention the
previously required commit.

Also, if 'hg add --large' was performed and then 'hg forget <file>' (both before
a largefile enabling commit), the forget command would error out saying
'.hglf/<file> not tracked'.  This is also fixed.

This reports that a repo is largefiles enabled as soon as a file is added with
--large, which enables 'add', 'addremove' and 'ci -A' to honor the config
settings before the first commit.  Note that prior to the next commit, if all
largefiles are forgotten, the repository goes back to reporting the repo as not
largefiles enabled.

It makes no sense to handle this by adding a --large option to 'addremove',
because then it would also be needed for 'commit', but only when '-A' is
specified.  While this gets around the awkwardness of having to add a largefile,
then commit it, and then addremove the other files when importing an existing
codebase (and preserving that extra commit in permanent history), it does still
require finding and manually adding one of the files as --large.  Therefore it
is probably desirable to have a --large option for init as well.
2012-07-30 20:56:41 -04:00
Matt Harbison
2aaabbf1cc largefiles: handle commit -A properly, after a --large commit (issue3542)
Previous to this, 'commit -A' would add as normal files, files that were already
committed as largefiles, resulting in files being listed twice by 'status -A'.
It also missed when (only) a largefile was deleted, even though status reported
it as '!'.  This also has the side effect of properly reporting the state of the
affected largefiles in the post commit hook after a remove that also affected a
normal file (the largefiles used to be 'R', now are properly absent).

Since scmutil.addremove() is called both by the ui command (after some trivial
argument validation) and during the commit process when -A is specified, it
seems like a more appropriate method to wrap than the addremove command.

Currently, a repo is only enabled to use largefiles after an add that explicitly
identifies some file as large, and a subsequent commit.  Therefore, this patch
only changes behavior after such a largefile enabling commit.

Note that in the test, if the final commit had a '-v', 'removing large8' would
be printed twice.  Both of these originate in removelargefiles().  The first
print is in verbose mode after traversing remove + forget, the second is because
the '_isaddremove' attr is set and 'after' is not.
2012-07-30 20:56:41 -04:00
Patrick Mezard
4da0fafc00 transplant: fix emptied changeset message
- Append an EOL
- State the changeset is skipped
2012-08-01 14:08:19 +02:00
Patrick Mezard
ba210ae123 transplant: handle non-empty patches doing nothing (issue2806)
If patch.patch() reports patched files when applying a changeset and the
following commit says nothing changed, transplant used to abort with a
RuntimeError, assuming something went wrong with patching.

The mismatch is patch.patch() reports patched files, not changed ones.
It could be modified to report changed files but it means duplicating
work from status, may be expensive in the case of binary files, and is
probably not that useful at API level. For instance, if two patches are
applied on the working directory, the outcome may be nothing changed
while each call would have returned modified files. The caller would
have to call status() itself again.

This patch fixes the issue by trusting patching code: if the patch
succeeded and commit reports nothing changed, then nothing changed,
patch() did not "dropped changes on the floor".
2012-07-31 17:39:32 +02:00
FUJIWARA Katsunori
846e85b25e histedit: make comment part of the file describing rules as translatable
"i18n.gettext()" invocation for "editcomment" itself should have
little impact for whole initialization cost of histedit, because it is
already invoked for initialization of the command table entry.

'\n\n' has to be added to the text being edited separately from
"editcomment", because leading 'line feed' characters are not exported
to "hg.pot" file correctly.
2012-07-30 03:27:07 +09:00
Thomas Arendsen Hein
ef236f0ec1 pager: drop -S option for less in example for pager configuration
Using less -S will hide possibly important information when reviewing a
changeset, e.g. something wrong/dangerous after the 80th column, because
"less" will not give an indication that following characters are hidden.
2012-07-31 15:50:44 +02:00
Mads Kiilerich
688b9e2048 check-code: indent 4 spaces in py files 2012-07-31 03:30:42 +02:00
Mads Kiilerich
ffa7814143 histedit: add trailing newline when editing commit messages
test-histedit-edit.t failed because Solaris sed strips lines not ending with
\n.
2012-07-30 03:53:38 +02:00
Simon Heimberg
74b66f52f4 largefiles: use hg.peer instead of hg.remoteui 2012-07-28 22:55:01 +02:00
FUJIWARA Katsunori
9b75cb3833 histedit: remove updating statistics line from the examples describing rules
Before this patch, updating statistics line appears at the bottom of
the examples describing rules to edit history.

But such line never appear in the file describing rules while
histedit-ing, so this patch removes that line from the examples.
2012-07-29 16:19:32 +09:00
Matt Harbison
2331fa9fcd largefiles: support revsets for outgoing --large
Previous to this, outgoing with a revset succeeded unless --large was also
specified.
2012-07-20 19:08:26 -04:00
Matt Harbison
1c93565f66 largefiles: fix a traceback introduced with recent peer changes
Changeset 9467184ce7e7 broke 'outgoing --large'

    ...
    File "hgext\largefiles\lfutil.py", line 56, in findoutgoing
      remote.local(), force=force)
    File "mercurial\discovery.py", line 31, in findcommonincoming
      if not remote.capable('getbundle'):
  AttributeError: 'lfilesrepo' object has no attribute 'capable'

This restores the previous functionality, though I'm not sure if there's a
better way to do this- that changeset introduces a hunk in debugdiscovery that
does this:

            if not util.safehasattr(remote, 'branches'):
                # enable in-client legacy support
                remote = localrepo.locallegacypeer(remote.local())

Is there a legacy support issue here too?
2012-07-20 23:50:52 -04:00
Matt Harbison
944ad7f58e largefiles: support revsets for cat
Previous to this, cat only accepted revsets if the largefiles extension was
disabled.
2012-07-20 19:14:41 -04:00
Matt Harbison
a7de7f0ce5 largefiles: support revsets for revert
Previous to this, revert only accepted revsets if the largefiles extension was
disabled.
2012-07-20 18:13:19 -04:00
FUJIWARA Katsunori
0cf97588a4 doc: unify section level between help topics
Some help topics use "-" for the top level underlining section mark,
but "-" is used also for the top level categorization in generated
documents: "hg.1.html", for example.

So, TOC in such documents contain "sections in each topics", too.

This patch changes underlining section mark in some help topics to
unify section level in generated documents.

After this patching, levels of each section marks are:

  level0
  """"""
    level1
    ======
      level2
      ------
        level3
        ......
          level4
          ######

And use of section markers in each documents are:

  - mercurial/help/*.txt can use level1 or more
    (now these use level1 and level2)

  - help for core commands can use level2 or more
    (now these use no section marker)

  - descriptions of extensions can use level2 or more
    (now hgext/acl uses level2)

  - help for commands defined in extension can use level4 or more
    (now "convert" of hgext/convert uses level4)

"Level0" is used as top level categorization only in "doc/hg.1.txt"
and the intermediate file generated by "doc/gendoc.py", so end users
don't see it in "hg help" outoput and so on.
2012-07-25 16:40:38 +09:00
Matt Mackall
387f7efad8 largefiles: fix exception hack for i18n (issue3197)
Properly fixing this is quite a bit trickier.
2012-07-27 12:33:48 -05:00
Mads Kiilerich
377db36818 help: fix some instances of 'the the' 2012-07-26 02:54:13 +02:00
Michael Bacarella
497a8d346f pager: work around bug in python 2.4's subprocess module (issue3533)
hg v2.2.2 fixed the pager on Windows, but broke it on Python 2.4.
This patch only uses the new behavior if Python >= 2.5 is detected.
2012-07-06 18:06:52 -04:00
Patrick Mezard
dc1b580b83 convert/svn: handle non-local svn destination paths (issue3142)
test-convert-svn-sink.t still pass and I tested pushing to an svn+ssh
repository
2012-07-26 12:07:55 +02:00
Matt Harbison
8e588880da largefiles: fix path handling for cp/mv (issue3516)
Previously, a copy or a move of a largefile only worked if the cwd was the root
of the repository.  The first issue was that the destination path passed to
os.mkdirs() chopped the absolute path to the standin after '.hglf/', which
essentially created a path relative to the repository root.  Similarly, the
second issue was that the source and dest paths for copyfile() were relative to
the repo root.  This converts these three paths to absolute paths.

Some notable issues, regardless of the directory in which the cp/mv is executed:

1) The copy is not being recorded in lfdirstate, but it is in dirstate for the
standins.  I'm not sure if this is by design (i.e. minimal info in lfdirstate).

2) status -C doesn't behave as expected.  Using the testcase as an example:

  # after mv + ci
  $ hg status -C -v --rev '.^'     # expected to see 'A' and ' ' lines too
  R dira\dirb\largefile

  $ hg status -C -v --rev '.^' foo/largefile
  # no output                      # expected to see 'A' and ' ' lines only

  $ hg status -C -v --rev '.^' foo/
  # no output                      # expected to see 'A', ' ' and 'R' lines

  $ hg status -C -v --rev '.^' ./  # expected to see 'A' and ' ' lines too
  R dirb\largefile

  $ hg status -C -v --rev '.^' ../.hglf/dira/foo/largefile
  A ..\.hglf\dira\foo\largefile
    ..\.hglf\dira\dirb\largefile  # no 'R' expected when new file is specified

  $ hg status -C -v --rev '.^' ../.hglf   # OK
  A ..\.hglf\dira\foo\largefile
    ..\.hglf\dira\dirb\largefile
  R ..\.hglf\dira\dirb\largefile
2012-07-22 23:37:53 -04:00
Patrick Mezard
e7c675580e histedit: fix new nodes computation with --continue (issue3534)
When running the following actions:

  pick 617f94f13c0f 1 +4
  drop 888f9082bf99 2 +5
  fold 251d831eeec5 3 +6

if the fold fails, is fixed by the user with a new changeset, --continue
will ignore the new revision when generating the fold changelog. This
was caused by --continue detecting new changesets as descendants of the
parent not descendants of changesets in the initial list. In this case,
dropped changesets must be ignored.

Even with the computation fixed, the 'newchildren' list was always
emptied by the filtering loop and passed empty to finishfold().

Note that changesets dropped and recreated identically will still be
missed. This probably cannot be solved but is unlikely to happen.

Other things, like 'newchildren' having multiple heads, should be
checked as well.
2012-07-25 16:27:26 +02:00
Patrick Mezard
3502d58447 histedit: end folding message with an LF
This is convenient when running tests dumping the editor content, it
avoids the following output line to be mixed with histedit message.
2012-07-25 11:09:51 +02:00
Matt Harbison
a6f5e08a5d largefiles: mark as a first party extension 2012-07-20 22:10:52 -04:00
Matt Harbison
a3f198c97e largefiles: ensure addlargefiles() doesn't add a standin as a largefile
An easy way to force this (and cause a traceback) prior to the fix for 3507 was

  $ touch large
  $ hg add --large large
  $ hg ci -m "add"
  $ hg remove large
  $ touch large
  $ hg addremove --config largefiles.patterns=**large

This patch also detected (and corrected) a previous test where a standin got
added as a largefile (without a traceback).
2012-07-19 23:35:13 -04:00
Matt Harbison
b617460d47 largefiles: fix a traceback when addremove follows a remove (issue3507)
The problem only occurred if a file was removed with 'hg rm' (as opposed to the
OS utilities), and then addremove was run before a commit.  Both normal and
large files were affected.

Ensuring that the file exists prior to an lstat() for size seems like the Right
Thing.  But oddly enough, the missing file that was causing lstat() to blow up
was a standin when a largefile was removed, which seems fishy, because a standin
should never be added as a largefile.  I was then able to get a standin added as
a largefile (whose name is 'large') with

   hg addremove --config largefiles.patterns=**large

which also causes a backtrace.  That will be fixed next.
2012-07-19 11:12:05 -04:00
Matt Harbison
f0d41a8692 largefiles: defer lfdirstate.drop() until after commit (issue3364)
The example in comment #9 of the bug writeup must be run exactly- it was the
commit after the rm and prior to the addremove that screwed things up, because
that commit noticed that the largefile was missing, called drop(), and then the
original commit function did nothing (due to the file in the '!' state).  The
addremove command properly put it into the 'R' state, but it remained stuck in
that state (because commit insisted 'nothing changed').  Without the commit
prior to addremove, the problem didn't occur.

Maybe this is an indication that lfdirstate needs to take a few more hints from
the regular dirstate, regardless of what _it_ thinks the state is- similar
inconsistency is probably still possible with this patch if the original commit
succeeds but the lfdirstate write fails.
2012-07-19 10:00:15 -04:00
Matt Harbison
91452ea7b9 largefiles: fix addremove with -R option
If a file was missing, the missing list contained a path relative to the repo.
When building the matcher from that list, the file name ended up concatenated to
cwd, causing the command to abort with '<file> not under root'.  This rebuilds
the missing list with paths relative to cwd.
2012-07-19 06:30:59 -04:00
Peter Arrenbrecht
ef7b77046e peer: introduce real peer classes
This change separates peer implementations from the repository implementation.
localpeer currently is a simple pass-through to localrepository, except for
legacy calls, which have already been removed from localpeer. This ensures that
the local client code only uses the most modern peer API when talking to local
repos.

Peers have a .local() method which returns either None or the underlying
localrepository (or descendant thereof). Repos have a .peer() method to return
a freshly constructed localpeer. The latter is used by hg.peer(), and also to
allow folks to pass either a peer or a repo to some generic helper methods.
We might want to get rid of .peer() eventually.

The only user of locallegacypeer is debugdiscovery, which uses it to pose as a
pre-setdiscovery client. But we decided to leave the old API defined in
locallegacypeer for clarity and maybe for other uses in the future.

It might be nice to actually define the peer API directly in peer.py as stub
methods. One problem there is, however, that localpeer implements
lock/addchangegroup, whereas the true remote peers implement unbundle.
It might be desireable to get rid of this distinction eventually.
2012-07-13 21:47:06 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Patrick Mezard
97e1660f02 convert: remove unused newnames variable in filemap 2012-07-16 15:50:19 +02:00
Patrick Mezard
1bc1374fa9 incoming/outgoing: handle --graph in core 2012-07-11 18:22:07 +02:00
Patrick Mezard
ea80881882 log: support --graph without graphlog extension
The glog command is preserved in the extension for backward compatibility.
2012-07-14 19:09:22 +02:00
Patrick Mezard
2d4a0ad972 graphlog: extract revset/support functions into cmdutil 2012-07-14 18:55:21 +02:00
Patrick Mezard
121450bf01 graphlog: extract ascii drawing code into graphmod 2012-07-11 17:13:39 +02:00
Patrick Mezard
f1c5b9a95f patchbomb: rewrite getoutgoing() with revsets
Another version could have returned a revset expression from
getoutgoing(), but we do not know how many times it will be resolved, so
better do it once explicitely.
2012-06-24 18:11:52 +02:00