Commit Graph

185 Commits

Author SHA1 Message Date
Augie Fackler
2578f4f9f2 subrepo: make stdin for svn a pipe for non-interactive use (issue2759)
This certainly can't hurt, so go ahead and do it, potentially along
with --non-interactive if that flag is safe for the given subcommand.
2011-05-31 19:49:17 -05:00
Regis Desgroppes
422cfa6bde subrepo: svn abort now depends on exit code (issue2833) 2011-05-31 16:22:04 -05:00
Matt Mackall
e5b463de99 merge with stable 2011-05-31 15:28:23 -05:00
Eric Eisner
55bac452e8 subrepo: don't crash when git .hgsubstate is empty (issue2716) 2011-05-28 11:03:48 -04:00
Martin Geisler
2edabc4530 subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
Paul Molodowitch
dfc345d9b5 subrepo: bare git repos considered dirty
Currently, if there is a bare git subrepo, but it is at the "right"
revision, calling dirty() will error because diff-index does not work
on bare repos. This patch makes it so bare subrepos are always
considered dirty.
2011-05-25 08:38:58 -07:00
Matt Mackall
db4e14bfa3 subrepo: handle local added subrepo case correctly 2011-05-23 22:49:10 -05:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Matt Mackall
8acd26be3c subrepo: use a safer revision check for hg repos
This avoids a traceback if the expected revision has been stripped.
2011-05-12 18:35:04 -05:00
Thomas Arendsen Hein
394d9f50d7 subrepo: use code from 1d866b621bf7 only if Python needs it (issue2795)
With Python >= 2.6 the original code already works correct, therefore the
fix for issue2556 on Python <= 2.5 broke relative subrepositories with
newer versions of Python.
2011-05-05 16:01:09 +02:00
Patrick Mezard
3616aca56a subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant and only works with svn >= 1.5 but the only
alternative I can think of is to write our own purge command for subversion.
2011-03-04 14:00:49 +01:00
Augie Fackler
a74cb339b1 subrepo: tell Subversion when we are non-interactive (issue2759)
$ hg clone repo repo-clone -v
  updating to branch default
  resolving manifests
  getting .hgsub
  getting .hgsubstate
  abort: svn: OPTIONS of 'https://subversion.srv/project': Server certificate
  verification failed: issuer is not trusted (https://subversion.srv)
2011-04-29 03:05:48 -05:00
Thomas Arendsen Hein
e97f821988 subrepo: prevent url normalization from removing // in ssh paths (issue2556) 2011-04-07 12:33:47 +02:00
Eric Eisner
3cc72a297f subrepo: recognize scp-style paths as git URLs 2011-03-17 16:29:09 -04:00
Patrick Mezard
cb64444c5f subrepo: backout 66e642f0195f, --force requires svn >= 1.5 2011-03-07 23:02:04 +01:00
Eric Eisner
25b04beb36 subrepo: don't crash when git repo is missing 2011-03-07 12:03:54 -05:00
Patrick Mezard
12049011b2 subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant but it is much simpler than rewriting our own
purge command for subversion.
2011-03-04 14:00:49 +01:00
Eric Eisner
52f3c93dfa subrepo: only attempt pulling from git's origin
git fetch does not accept repository URLs as arguments, and the intended
logic of this code was not actually doing anything.
2011-02-23 10:59:36 -05:00
Eric Eisner
fc76e4918d subrepo: disallow all unknown git ref types 2011-02-23 10:17:44 -05:00
Eric Eisner
16fbbf312c subrepo: expand relative sources for git subrepos 2011-02-22 15:11:10 -05:00
Martin Geisler
d9e6fe01b4 subrepo: break long line found by check-code 2011-02-17 09:20:44 +01:00
Kevin Bullock
720b543cad subrepos: print short git changeset ids
This changes the prompts on git subrepos to show only the first seven
digits of git changeset IDs (as git's command line does):

    $ hg update
    subrepository sources for s differ (in checked out version)
    use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
2011-02-16 11:53:48 -06:00
Erik Zielke
1d125c0477 subrepos: prompt on conflicts on update with dirty subrepos
Consider a repository with a single subrepository. The changesets in
the main repository reference the subrepository changesets like this:

  m0 -> s0
  m1 -> s1
  m2 -> s2

Starting from a state (m1, s0), doing 'hg update m2' in the main
repository will yield a conflict: the subrepo is at revision s0 but
the target revision says it should be at revision s2.

Before this change, Mercurial would do (m1, s0) -> (m2, s2) and thus
ignore the conflict between the working copy and the target revision.

With this change, the user is prompted to resolve the conflict by
choosing which revision he wants. This is consistent with 'hg merge',
which also prompts the user when it detects conflicts in the merged
.hgsubstate files.

The prompt looks like this:

  $ hg update tip
   subrepository sources for my-subrepo differ
  use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
2011-02-09 10:53:09 +01:00
Erik Zielke
2017770368 subrepo: remove argument introduced by mistake in e3640daa4703 2011-02-09 13:37:21 +01:00
Patrick Mezard
15ac0306ee Merge with stable 2011-02-01 21:59:07 +01:00
Patrick Mezard
339c6194d0 subrepo: fix update -C with svn subrepos when cwd != repo.root 2011-02-01 21:39:28 +01:00
Erik Zielke
bf9e13d063 subrepo: make update -C clean the working directory for svn subrepos
This makes 'hg update --clean' behave the same way for both kinds of
subrepositories. Before Subversion subrepos did not take the clean
parameter into account, but just updated to the given revision and
merged uncommitted changes into that.
2011-01-31 13:33:41 +01:00
Patrick Mezard
afb494e2e2 subrepo: compare svn subrepo state to last committed revision
A subversion project revisions are a subset of the repository revisions, you
can ask subversion to update a working directory from one revision to another
without changing anything. Unfortunately, Mercurial will think the
subrepository has changed and will commit it again. To avoid useless commits,
we compare the subrepository state to its actual "parent" revision. To ensure
ascending compatibility with existing subrepositories which might reference
fake revisions, we also keep comparing with the subrepo working directory
revision.

NOTE: not sure if this should go in stable or not.
2011-01-22 16:15:40 +01:00
Kevin Bullock
356b5c3414 subrepo: clarify comments in dirty() methods
Just a little change to bring the comments in the dirty() methods of the
various subrepo classes into a uniform structure. This clarifies the
meaning of the states checked.
2011-01-04 10:42:00 -06:00
Erik Zielke
68282c3062 subrepo: make update -C clean the working directory for git subrepos
This makes 'hg update --clean' behave the same way for all three kinds
of subrepositories [hg, svn, git]. Before git subrepos did not take
the clean parameter into account, but just updated to the given
revision and merged uncommitted changes into that.
2011-01-31 13:40:05 +01:00
Martin Geisler
17df79113a merge with stable 2011-01-31 13:38:00 +01:00
Patrick Mezard
276b88543c Merge with stable 2011-01-22 16:29:10 +01:00
Kevin Bullock
e69254e948 subrepo: fix svnsubrepo.dirty() checking of ignoreupdate (issue2499)
The ignoreupdate flag to subrepo.dirty(), introduced in 55e4073493fc, is
correctly checked with this change.
2011-01-04 11:33:47 -06:00
Matt Mackall
eec34ddf7c subrepo: backed out changeset 9ce26f91f137 2010-12-10 19:08:17 -06:00
Mads Kiilerich
9933c7a60f subrepo: initialize subrepo relative default paths relative to their root 2010-12-10 01:30:16 +01:00
Eric Eisner
5a68596380 subrepo: basic support for status of git subrepos 2010-12-20 13:59:33 -05:00
Eric Eisner
ca54cd3a42 subrepo: fix subrelpath for git subrepos
This patch conforms gitsubrepo code to the variable naming scheme of the other
subrepo implementations. All user-facing path references should be relative
to the root repository.
2010-12-20 13:59:33 -05:00
Eric Eisner
ec2e32efb2 subrepo: fix git archive parsing of directories and symfiles 2010-12-20 13:59:33 -05:00
Eric Eisner
056bbfc80f subrepo: support ignoreupdate in gitsubrepo's dirty() 2010-12-20 13:59:33 -05:00
Eric Eisner
c6b2baa3dd subrepo: backout 4f4b977c5189
Unfortunately git 1.6 does not support the upstream parameter in for-each-ref.
2010-12-20 13:59:19 -05:00
Kevin Bullock
5c61f5f136 mq: update .hgsubstate if subrepos are clean (issue2499)
This patch prevents MQ from creating an inconsistent subrepo state. If
the .hgsub file has been changed, and none of the subrepos have
uncommitted changes, creating or updating a patch (using qnew, qrefresh,
or qrecord) will update .hgsubstate accordingly.

If any subrepos _do_ have uncommitted changes, qnew/qrefresh/qrecord
will abort.

Thanks to pmezard for proposing this solution.
2010-12-07 22:14:43 -06:00
Erik Zielke
d12bb06bf6 subrepo: backout 9f2d8e1439d7
backing out 9f2d8e1439d7 because it introduced a bug in
.hgsubstate handling.
2010-12-17 13:38:15 +01:00
Matt Mackall
cdcb8c0f47 check-code: catch "except as" 2010-12-16 14:50:36 -06:00
Erik Zielke
19fa82cefe subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)
This patch avoids empty commit when .hgsubstate is dirty. Empty commit
was caused by .hgsubstate being updated back to the state of the
working copy parent when committing, if a user had changed it manually
and not made any changes in subrepositories.

The subrepository state from the working copies parent is compared
with the state calculated as a result of trying to commit the
subrepositories. If the two states are the same, then return None
otherwise the commit is just done.

The line: "committing subrepository x" will be written if there is
nothing committed, but .hgsubstate is dirty for x subrepository.
2010-11-29 09:37:23 +01:00
Eric Eisner
06990b8d8e subrepo: use low-level git-diff-index for dirty()
Despite its name, git-diff-index compares a revision to the files in the
working directory. This seems way less sketchy and more future proof than
parsing human-readable git-status.
2010-12-14 21:58:13 -05:00
Eric Eisner
1e1100a33b subrepo: defer determination of git's current branch 2010-12-14 21:56:43 -05:00
Eric Eisner
2c85454675 subrepo: incorporate tracking branches into gitbranchmap 2010-12-14 21:56:43 -05:00
Eric Eisner
26d7ede580 subrepo: use low-level git-for-each-ref command in branchmap
This command's output doesn't change across versions, and it also
disambiguates cases where there are slashes in local branch names.
2010-12-14 21:53:40 -05:00
Martin Geisler
290569c6d1 subrepo: add progress bar support to archive 2010-11-29 16:34:10 +01:00
Matt Mackall
4866a8eb9e subrepo: re-backout 9ce26f91f137
This bug got introduced into default simultaneously with its backout,
so future merges didn't eradicate it.
2010-12-14 18:10:51 -06:00