Merge lp:~geoff.bache/bzr/trunk into lp:bzr

Proposed by Robert Collins
Status: Merged
Merge reported by: Martin Pool
Merged at revision: not available
Proposed branch: lp:~geoff.bache/bzr/trunk
Merge into: lp:bzr
Diff against target: 571 lines (+501/-0) (has conflicts)
3 files modified
NEWS (+453/-0)
bzrlib/osutils.py (+19/-0)
bzrlib/tests/blackbox/test_add.py (+29/-0)
Text conflict in NEWS
Text conflict in bzrlib/osutils.py
Text conflict in bzrlib/tests/blackbox/test_add.py
To merge this branch: bzr merge lp:~geoff.bache/bzr/trunk
Reviewer Review Type Date Requested Status
John A Meinel Needs Fixing
Robert Collins (community) Needs Information
Review via email: mp+28463@code.launchpad.net

Commit message

Behave better when adding symlinks or things found via symlinks.

Description of the change

Handle 'bzr add symlink' (adds the symlink) and 'bzr add symlink/something' (adds something in the tree that something is actually contained in).

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Need to audit this; we've clearly got *some* code in a similar direction merged from elsewhere already.

review: Needs Information
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> Robert Collins has proposed merging lp:~geoff.bache/bzr/trunk into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #183831 bzr add <symlink> follows the link
> https://bugs.launchpad.net/bugs/183831
>
>
> Handle 'bzr add symlink' (adds the symlink) and 'bzr add symlink/something' (adds something in the tree that something is actually contained in).
>

 review: needsfixing

Quite a few things here.

1) It applies to a very old NEWS, before it was reformatted. So that
needs to be cleaned up and put in the new area.

2) + def test_add_with_symlink(self):
+ if not hasattr(os, "symlink"):
+ raise TestNotApplicable("Symbolic links not present")

We have a feature for symlinks that should be used.

3) I don't understand why this is getting added:
+ def test_add_with_wildcards_unicode(self):

4) The core loop is all confused because the patch is out-of-date.

5) The core loop is calling a function that will raise an exception for
every piece of the path processed.

To do it correctly, we should probably pull 'samepath()' into osutils.
And do:

def _samefile(f1, f2):
  return f1 == f2
samefile = getattr(os.path, 'samefile', _samefile)

Or something along those lines.

I don't really understand why samefile(head, base) is getting called,
nor why that would actually fix the symlink issues.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwjyWcACgkQJdeBCYSNAAPg0QCg2HFhbBAYz2Y6zStD+BreezZc
bLoAnif5CgEntdRzfz2Q0uUlE0VqZxZx
=3ABk
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
John A Meinel (jameinel) wrote :

I'll poke at this and see if I can get it cleaned up.

Revision history for this message
Martin Pool (mbp) wrote :

John merged the equivalent of this. Thanks for the branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-06-23 08:14:21 +0000
+++ NEWS 2010-06-24 20:53:32 +0000
@@ -1,5 +1,6 @@
1####################1####################
2Bazaar Release Notes2Bazaar Release Notes
3<<<<<<< TREE
3####################4####################
45
5.. contents:: List of Releases6.. contents:: List of Releases
@@ -4548,6 +4549,458 @@
4548:Codename: 12345678904549:Codename: 1234567890
4549:1.12: 2009-02-134550:1.12: 2009-02-13
4550:1.12rc1: 2009-02-104551:1.12rc1: 2009-02-10
4552=======
4553--------------------
4554
4555.. contents::
4556
4557
4558
4559IN DEVELOPMENT
4560--------------
4561
4562 COMPATIBILITY BREAKS:
4563
4564 * bzr no longer autodetects nested trees as 'tree-references'. They
4565 must now be explicitly added tree references. At the commandline, use
4566 join --reference instead of add. (Aaron Bentley)
4567
4568 NEW FEATURES:
4569
4570 * shelve can now apply changes without storing anything on the shelf, via
4571 the new --destroy option. (Aaron Bentley)
4572
4573 * ``bzr send`` now accepts --body to specify an initial message body.
4574 (Aaron bentley)
4575
4576 IMPROVEMENTS:
4577
4578 * Branching from a stacked branch using ``bzr*://`` will now stream
4579 the data when the target repository does not need topological
4580 ordering, reducing round trips and network overhead. This uses the
4581 existing smart server methods added in 1.13, so will work on any
4582 1.13 or newer server. (Robert Collins, Andrew Bennetts)
4583
4584 * ``bzr ignore`` gives a more informative message when existing
4585 version controlled files match the ignore pattern. (Neil
4586 Martinsen-Burrell, #248895)
4587
4588 * Progress bars now show the rate of network activity for
4589 ``bzr+ssh://`` and ``bzr://`` connections. (Andrew Bennetts)
4590
4591 * Streaming push can be done to older repository formats. This is
4592 implemented using a new ``Repository.insert_stream_locked`` RPC.
4593 (Andrew Bennetts, Robert Collins)
4594
4595 * Tildes are no longer escaped. No more %7Euser/project/branch!
4596 (Jonathan Lange)
4597
4598 BUG FIXES:
4599
4600 * Authentication plugins now receive all the parameters from the request
4601 itself (aka host, port, realm, path, etc). Previously, only the
4602 authentication section name, username and encoded password were
4603 provided. (Jean-Francois Roy)
4604
4605 * Fix "is not a stackable format" error when pushing a
4606 stackable-format branch with an unstackable-format repository to a
4607 destination with a default stacking policy. (Andrew Bennetts)
4608
4609 * Fixed incorrect "Source format does not support stacking" warning
4610 when pushing to a smart server. (Andrew Bennetts, #334114)
4611
4612 * It is no longer possible to fetch between repositories while the
4613 target repository is in a write group. This prevents race conditions
4614 that prevent the use of RPC's to perform fetch, and thus allows
4615 optimising more operations. (Robert Collins, Andrew Bennetts)
4616
4617 * ``merge --force`` works again. (Robert Collins, #342105)
4618
4619 * The GNU Changelog formatter is slightly improved in the case where
4620 the delta is empty, and now correctly claims not to support tags.
4621 (Andrea Bolognani)
4622
4623 * Shelve can now shelve changes to a symlink target.
4624 (James Westby, #341558)
4625
4626 * 'add' now works if there is a symlink in the path to the repository
4627 (Geoff Bache, #183831)
4628
4629 DOCUMENTATION:
4630
4631 * New topic `bzr help debug-flags`. (Martin Pool)
4632
4633 * The generated manpage now explicitly lists aliases as commands.
4634 (James Westby, #336998)
4635
4636 API CHANGES:
4637
4638 * New sort order for ``get_record_stream`` ``groupcompress`` which
4639 sorts optimally for use with groupcompress compressors. (John Arbash
4640 Meinel, Robert Collins)
4641
4642 * The ``get_credentials`` and ``set_credentials`` methods of
4643 ``AuthenticationConfig`` now accept an optional realm argument.
4644 (Jean-Francois Roy)
4645
4646 * The ``pb`` argument to ``fetch()`` is deprecated.
4647 (Martin Pool)
4648
4649 TESTING:
4650
4651 * ``bzrlib.tests.TestCase`` now fails the test if its own ``setUp``
4652 and ``tearDown`` weren't called. This catches faulty tests that
4653 forget to upcall when overriding ``setUp`` and ``tearDown``. Those
4654 faulty tests were not properly isolated.
4655 (Andrew Bennetts, Robert Collins)
4656
4657 INTERNALS:
4658
4659 * New ``assertLength`` method based on one Martin has squirreled away
4660 somewhere. (Robert Collins, Martin Pool)
4661
4662 * New repository method ``refresh_data`` to cause any repository to
4663 make visible data inserted into the repository by a smart server
4664 fetch operation. (Robert Collins, Andrew Bennetts)
4665
4666 * Removed ``InterRemoteToOther``, ``InterOtherToRemote`` and
4667 ``InterPackToRemotePack`` classes, as they are now unnecessary.
4668 (Andrew Bennetts)
4669
4670 * ``_walk_to_common_revisions`` will now batch up at least 50
4671 revisions before calling ``get_parent_map`` on the target,
4672 regardless of ``InterRepository``.
4673 (Andrew Bennetts, Robert Collins)
4674
4675
4676bzr 1.13rc1 "paraskavedekatriaphobia" 2009-03-10
4677------------------------------------------------
4678This release includes bug fixes and a few performance and feature improvements.
4679GNU Changelog output can now be produced by ``bzr log --format gnu-changelog``.
4680Debug flags can now be set in ``~/.bazaar/bazaar.conf``. Lightweight Checkouts
4681and Stacked Branches should both be much faster over remote connections.
4682
4683 COMPATIBILITY BREAKS:
4684
4685 * ``bzr log --line`` now indicates which revisions are merges with
4686 `[merge]` after the date. Scripts which parse the output of this
4687 command may need to be adjusted.
4688 (Neil Martinsen-Burrell)
4689
4690 NEW FEATURES:
4691
4692 * ``bzr reconfigure`` now supports --with-trees and --with-no-trees
4693 options to change the default tree-creation policy of shared
4694 repositories. (Matthew Fuller, Marius Kruger, #145033)
4695
4696 * Debug flags can now be set in ``~/.bazaar/bazaar.conf``.
4697 (Martin Pool)
4698
4699 * Filtered views provide a mask over the tree so that users can focus
4700 on a subset of a tree when doing their work. See ``Filtered views``
4701 in chapter 7 of the User Guide and ``bzr help view`` for details.
4702 (Ian Clatworthy)
4703
4704 * GNU Changelog output can now be produced by ``bzr log --format
4705 gnu-changelog``. (Andrea Bolognani, Martin Pool)
4706
4707 * The ``-Dmemory`` flag now gives memory information on Windows.
4708 (John Arbash Meinel)
4709
4710 * Multiple authors for a commit can now be recorded by using the "--author"
4711 option multiple times. (James Westby, #185772)
4712
4713 * New clean-tree command, from bzrtools. (Aaron Bentley, Jelmer Vernoij)
4714
4715 * New command ``bzr launchpad-open`` opens a Launchpad web page for that
4716 branch in your web browser, as long as the branch is on Launchpad at all.
4717 (Jonathan Lange)
4718
4719 * New API for getting bugs fixed by a revision: Revision.iter_bugs().
4720 (Jonathan Lange)
4721
4722 IMPROVEMENTS:
4723
4724 * All bzr ``Hooks`` classes are now registered in
4725 ``bzrlib.hooks.known_hooks``. This removes the separate list from
4726 ``bzrlib.tests`` and ensures that all hooks registered there are
4727 correctly isolated by the test suite (previously
4728 ``MutableTreeHooks`` were not being isolated correctly). Further,
4729 documentation for hooks is now dynamically generated from the
4730 present HookPoints. ``bzr hooks`` will now also report on all the
4731 hooks present in the ``bzrlib.hooks.known_hooks`` registry.
4732 (Robert Collins)
4733
4734 * ``bzr add`` no longer prints ``add completed`` on success. Failure
4735 still prints an error message. (Robert Collins)
4736
4737 * ``bzr branch`` now has a ``--no-tree`` option which turns off the
4738 generation of a working tree in the new branch.
4739 (Daniel Watkins, John Klinger, #273993)
4740
4741 * Bazaar will now point out ``bzr+ssh://`` to the user when they
4742 use ssh://. (Jelmer Vernooij, #330535)
4743
4744 * ``bzr -v info`` now omits the number of committers branch statistic,
4745 making it many times faster for large projects. To include that
4746 statistic in the output, use ``bzr -vv info``.
4747 (Ian Clatworthy)
4748
4749 * ``bzr push`` to a ``bzr`` url (``bzr://``, ``bzr+ssh://`` etc) will
4750 stream if the server is version 1.13 or greater, reducing roundtrips
4751 significantly. (Andrew Bennetts, Robert Collins)
4752
4753 * Lightweight Checkouts and Stacked Branches should both be much
4754 faster over remote connections. Building the working tree now
4755 batches up requests into approx 5MB requests, rather than a separate
4756 request for each file. (John Arbash Meinel)
4757
4758 * Support for GSSAPI authentication when using HTTP or HTTPS.
4759 (Jelmer Vernooij)
4760
4761 * The ``bzr shelve`` prompt now includes a '?' help option to explain the
4762 short options better. (Daniel Watkins, #327429)
4763
4764 * ``bzr lp-open`` now falls back to the push location if it cannot find a
4765 public location. (Jonathan Lange, #332372)
4766
4767 * ``bzr lp-open`` will try to find the Launchpad URL for the location
4768 passed on the command line. This makes ``bzr lp-open lp:foo`` work as
4769 expected. (Jonathan Lange, #332705)
4770
4771 * ``bzr send`` now supports MH-E via ``emacsclient``. (Eric Gillespie)
4772
4773 BUG FIXES:
4774
4775 * Bazaar now gives a better message including the filename if it's
4776 unable to read a file in the working directory, for example because
4777 of a permission error. (Martin Pool, #338653)
4778
4779 * ``bzr cat -r<old> <path>`` doesn't traceback anymore when <path> has a
4780 file id in the working tree different from the one in revision <old>.
4781 (Vincent Ladeuil, #341517, #253806)
4782
4783 * ``bzr send`` help is more specific about how to apply merge
4784 directives. (Neil Martinsen-Burrell, #253470)
4785
4786 * ``bzr missing`` now uses ``Repository.get_revision_delta()`` rather
4787 than fetching trees and determining a delta itself. (Jelmer
4788 Vernooij, #315048)
4789
4790 * ``bzr push`` to a smart server no longer causes "Revision
4791 {set([('null:',)])} not present ..." errors when the branch has
4792 multiple root revisions. (Andrew Bennetts, #317654)
4793
4794 * ``bzr shelve`` now properly handle patches with no terminating newline.
4795 (Benoît PIERRE, #303569)
4796
4797 * ``bzr unshelve`` gives a more palatable error if passed a non-integer
4798 shelf id. (Daniel Watkins)
4799
4800 * Export now handles files that are not present in the tree.
4801 (James Westby, #174539)
4802
4803 * Fixed incorrect "Source format does not support stacking" warning
4804 when pushing to a smart server. (Andrew Bennetts, #334114)
4805
4806 * Fixed "sprout() got an unexpected keyword argument 'source_branch'"
4807 error branching from old repositories.
4808 (Martin Pool, #321695)
4809
4810 * Make ``bzr push --quiet <non-local location>`` less chatty.
4811 (Kent Gibson, #221461)
4812
4813 * Many Branch hooks would not fire with ``bzr://`` and ``bzr+ssh://``
4814 branches, and this was not noticed due to a bug in the test logic
4815 for branches. This is now fixed and a test added to prevent it
4816 reoccuring. (Robert Collins, Andrew Bennetts)
4817
4818 * Restore the progress bar on Windows. We were disabling it when TERM
4819 wasn't set, but Windows doesn't set TERM. (Alexander Belchenko)
4820
4821 * ``setup.py build_ext`` now gives a proper error when an extension
4822 fails to build. (John Arbash Meinel)
4823
4824 * Symlinks to non ascii file names are now supported.
4825 (Robert Collins, Vincent Ladeuil, #339055, #272444)
4826
4827 * Under rare circumstances (aka nobody reported a bug about it), the ftp
4828 transport could revert to ascii mode. It now stays in binary mode except
4829 when needed.
4830 (Vincent Ladeuil)
4831
4832 * Unshelve does not generate warnings about progress bars.
4833 (Aaron Bentley, #328148)
4834
4835 * shelve cleans up properly when unversioned files are specified.
4836 (Benoît Pierre, Aaron Bentley)
4837
4838 DOCUMENTATION:
4839
4840 * Added ``Organizing your workspace`` to the User Guide appendices,
4841 summarizing some common ways of organizing trees, branches and
4842 repositories and the processes/workflows implied/enabled by each.
4843 (Ian Clatworthy)
4844
4845 * Hooks can now be self documenting. ``bzrlib.hooks.Hooks.create_hook``
4846 is the entry point for this feature. (Robert Collins)
4847
4848 * The documentation for ``shelve`` and ``unshelve`` has been clarified.
4849 (Daniel Watkins, #327421, #327425)
4850
4851 API CHANGES:
4852
4853 * ``bzr selftest`` now fails if the bazaar sources contain trailing
4854 whitespace, non-unix style line endings and files not ending in a
4855 newline. About 372 files and 3243 lines with trailing whitespace was
4856 updated to comply with this. The code already complied with the other
4857 criteria, but now it is enforced. (Marius Kruger)
4858
4859 ``bzrlib.branch.PushResult`` was renamed to
4860 ``bzrlib.branch.BranchPushResult``. (Jelmer Vernooij)
4861
4862 * ``Branch.fetch`` and ``Repository.fetch`` now return None rather
4863 than a count of copied revisions and failed revisions. A while back
4864 we stopped ever reporting failed revisions because we started
4865 erroring instead, and the copied revisions count is not used in the
4866 UI at all - indeed it only reflects the repository status not
4867 changes to the branch itself. (Robert Collins)
4868
4869 * ``Inventory.apply_delta`` now raises an AssertionError if a file-id
4870 appears multiple times within the delta. (Ian Clatworthy)
4871
4872 * MutableTree.commit now favours the "authors" argument, with the old
4873 "author" argument being deprecated.
4874
4875 * Remove deprecated EmptyTree. (Martin Pool)
4876
4877 * ``Repository.fetch`` now accepts an optional ``fetch_spec``
4878 parameter. A ``SearchResult`` or ``MiniSearchResult`` may be passed
4879 to ``fetch_spec`` instead of a ``last_revision`` to specify exactly
4880 which revisions to fetch. (Andrew Bennetts)
4881
4882 * ``RepositoryAcquisitionPolicy.acquire_repository`` now returns a
4883 tuple of ``(repository, is_new_flag)``, rather than just the
4884 repository. (Andrew Bennetts)
4885
4886 * Revision.get_apparent_author() is now deprecated, replaced by
4887 Revision.get_apparent_authors(), which returns a list. The former
4888 now returns the first item that would be returned from the second.
4889
4890 * The ``BranchBuilder`` test helper now accepts a ``timestamp``
4891 parameter to ``build_commit`` and ``build_snapshot``. (Martin Pool)
4892
4893 * The ``_fetch_*`` attributes on ``Repository`` are now on
4894 ``RepositoryFormat``, more accurately reflecting their intent (they
4895 describe a disk format capability, not state of a particular
4896 repository of that format). (Robert Collins)
4897
4898 INTERNALS:
4899
4900 * Branching from a non-stacked branch on a smart protocol is now
4901 free of virtual file system methods.
4902 (Robert Collins, Andrew Bennetts)
4903
4904 * Branch and Repository creation on a bzr+ssh://server are now done
4905 via RPC calls rather than VFS calls, reducing round trips for
4906 pushing new branches substantially. (Robert Collins)
4907
4908 * ``Branch.clone`` now takes the ``repository_policy`` formerly used
4909 inside ``BzrDir.clone_on_transport``, allowing stacking to be
4910 configured before the branch tags and revision tip are set. This
4911 fixes a race condition cloning stacked branches that would cause
4912 plugins to have hooks called on non-stacked instances.
4913 (Robert Collins, #334187)
4914
4915 * ``BzrDir.cloning_metadir`` now has a RPC call. (Robert Collins)
4916
4917 * ``BzrDirFormat.__str__`` now uses the human readable description
4918 rather than the sometimes-absent disk label. (Robert Collins)
4919
4920 * ``bzrlib.fetch`` is now composed of a sender and a sink component
4921 allowing for decoupling over a network connection. Fetching from
4922 or into a RemoteRepository with a 1.13 server will use this to
4923 stream the operation.
4924 (Andrew Bennetts, Robert Collins)
4925
4926 * ``bzrlib.tests.run_suite`` accepts a runner_class parameter
4927 supporting the use of different runners. (Robert Collins)
4928
4929 * Change how file_ids and revision_ids are interned as part of
4930 inventory deserialization. Now we use the real ``intern()``, rather
4931 than our own workaround that would also cache a Unicode copy of the
4932 string, and never emptied the cache. This should slightly reduce
4933 memory consumption. (John Arbash Meinel)
4934
4935 * New branch method ``create_clone_on_transport`` that returns a
4936 branch object. (Robert Collins)
4937
4938 * New hook Commands['extend_command'] to allow plugins to access a
4939 command object before the command is run (or help generated from
4940 it), without overriding the command. (Robert Collins)
4941
4942 * New version of the ``BzrDir.find_repository`` verb supporting
4943 ``_network_name`` to support removing more _ensure_real calls.
4944 (Robert Collins)
4945
4946 * ``RemoteBranchFormat`` no longer claims to have a disk format string.
4947 (Robert Collins)
4948
4949 * ``Repository`` objects now have ``suspend_write_group`` and
4950 ``resume_write_group`` methods. These are currently only useful
4951 with pack repositories. (Andrew Bennetts, Robert Collins)
4952
4953 * ``BzrDirFormat``, ``BranchFormat`` and ``RepositoryFormat`` objects
4954 now have a ``network_name`` for passing the format across RPC calls.
4955 (Robert Collins, Andrew Bennetts)
4956
4957 * ``RepositoryFormat`` objects now all have a new attribute
4958 ``_serializer`` used by fetch when reserialising is required.
4959 (Robert Collins, Andrew Bennetts)
4960
4961 * Some methods have been pulled up from ``BzrBranch`` to ``Branch``
4962 to aid branch types that are not bzr branch objects (like
4963 RemoteBranch). (Robert Collins, Andrew Bennetts)
4964
4965 * Test adaptation has been made consistent throughout the built in
4966 tests. ``TestScenarioApplier``, ``multiply_tests_from_modules``,
4967 ``adapt_tests``, ``adapt_modules`` have all been deleted. Please
4968 use ``multiply_tests``, or for lower level needs ``apply_scenarios``
4969 and ``apply_scenario``. (Robert Collins)
4970
4971 * ``TestSkipped`` is now detected by TestCase and passed to the
4972 ``TestResult`` by calling ``addSkip``. For older TestResult objects,
4973 where ``addSkip`` is not available, ``addError`` is still called.
4974 This permits test filtering in subunit to strip out skipped tests
4975 resulting in a faster fix-shrink-list-run cycle. This is compatible
4976 with the testtools protocol for skips. (Robert Collins)
4977
4978 * The ``_index`` of ``KnitVersionedFiles`` now supports the ability
4979 to scan an underlying index that is going to be incorporated into
4980 the ``KnitVersionedFiles`` object, to determine if it has missing
4981 delta references. The method is ``scan_unvalidated_index``.
4982 (Andrew Bennetts, Robert Collins)
4983
4984 * There is a RemoteSink object which handles pushing to smart servers.
4985 (Andrew Bennetts, Robert Collins)
4986
4987 * ``TransportTraceDecorator`` now logs ``put_bytes_non_atomic`` and
4988 ``rmdir`` calls. (Robert Collins)
4989
4990 * ``VersionedFiles`` record adapters have had their signature change
4991 from ``(record, record.get_bytes_as(record.storage_kind))`` to
4992 ``(record)`` reducing excess duplication and allowing adapters
4993 to access private data in record to obtain content more
4994 efficiently. (Robert Collins)
4995
4996 * We no longer probe to see if we should create a working tree during
4997 clone if we cannot get a local_abspath for the new bzrdir.
4998 (Robert Collins)
4999
5000
5001bzr 1.12 "1234567890" 2009-02-13
5002--------------------------------
5003>>>>>>> MERGE-SOURCE
45515004
4552This release of Bazaar contains many improvements to the speed,5005This release of Bazaar contains many improvements to the speed,
4553documentation and functionality of ``bzr log`` and the display of logged5006documentation and functionality of ``bzr log`` and the display of logged
45545007
=== modified file 'bzrlib/osutils.py'
--- bzrlib/osutils.py 2010-06-18 10:57:20 +0000
+++ bzrlib/osutils.py 2010-06-24 20:53:32 +0000
@@ -1128,6 +1128,14 @@
1128 else:1128 else:
1129 return False1129 return False
11301130
1131def samefile(f1, f2):
1132 """ Just a patch for os.path.samefile which would probably be more helpful
1133 if it existed and did this on Windows...
1134 """
1135 try:
1136 return os.path.samefile(f1, f2)
1137 except (AttributeError, OSError):
1138 return f1 == f2
11311139
1132def relpath(base, path):1140def relpath(base, path):
1133 """Return path relative to base, or raise PathNotChild exception.1141 """Return path relative to base, or raise PathNotChild exception.
@@ -1152,14 +1160,25 @@
11521160
1153 s = []1161 s = []
1154 head = rp1162 head = rp
1163<<<<<<< TREE
1155 while True:1164 while True:
1156 if len(head) <= len(base) and head != base:1165 if len(head) <= len(base) and head != base:
1157 raise errors.PathNotChild(rp, base)1166 raise errors.PathNotChild(rp, base)
1158 if head == base:1167 if head == base:
1159 break1168 break
1160 head, tail = split(head)1169 head, tail = split(head)
1170=======
1171 while not samefile(head, base):
1172 head, tail = os.path.split(head)
1173>>>>>>> MERGE-SOURCE
1161 if tail:1174 if tail:
1175<<<<<<< TREE
1162 s.append(tail)1176 s.append(tail)
1177=======
1178 s.insert(0, tail)
1179 else:
1180 raise errors.PathNotChild(rp, base)
1181>>>>>>> MERGE-SOURCE
11631182
1164 if s:1183 if s:
1165 return pathjoin(*reversed(s))1184 return pathjoin(*reversed(s))
11661185
=== modified file 'bzrlib/tests/blackbox/test_add.py'
--- bzrlib/tests/blackbox/test_add.py 2010-02-23 07:43:11 +0000
+++ bzrlib/tests/blackbox/test_add.py 2010-06-24 20:53:32 +0000
@@ -19,6 +19,7 @@
1919
20import os20import os
2121
22<<<<<<< TREE
22from bzrlib import (23from bzrlib import (
23 osutils,24 osutils,
24 tests,25 tests,
@@ -41,6 +42,14 @@
41 def make_branch_and_tree(self, dir):42 def make_branch_and_tree(self, dir):
42 return super(TestAdd, self).make_branch_and_tree(43 return super(TestAdd, self).make_branch_and_tree(
43 dir, format=self.branch_tree_format)44 dir, format=self.branch_tree_format)
45=======
46from bzrlib.tests.blackbox import ExternalBase
47from bzrlib.tests.test_win32utils import NeedsGlobExpansionFeature
48from bzrlib.tests import TestNotApplicable
49
50
51class TestAdd(ExternalBase):
52>>>>>>> MERGE-SOURCE
4453
45 def test_add_reports(self):54 def test_add_reports(self):
46 """add command prints the names of added files."""55 """add command prints the names of added files."""
@@ -211,9 +220,29 @@
211 out = self.run_bzr(['add', 'link/top.txt'])[0]220 out = self.run_bzr(['add', 'link/top.txt'])[0]
212 self.assertEquals(out, 'adding top.txt\n')221 self.assertEquals(out, 'adding top.txt\n')
213222
223<<<<<<< TREE
214 def test_add_symlink_to_abspath(self):224 def test_add_symlink_to_abspath(self):
215 self.requireFeature(tests.SymlinkFeature)225 self.requireFeature(tests.SymlinkFeature)
216 self.make_branch_and_tree('tree')226 self.make_branch_and_tree('tree')
217 os.symlink(osutils.abspath('target'), 'tree/link')227 os.symlink(osutils.abspath('target'), 'tree/link')
218 out = self.run_bzr(['add', 'tree/link'])[0]228 out = self.run_bzr(['add', 'tree/link'])[0]
219 self.assertEquals(out, 'adding link\n')229 self.assertEquals(out, 'adding link\n')
230=======
231 def test_add_with_wildcards_unicode(self):
232 self.requireFeature(NeedsGlobExpansionFeature)
233 self.make_branch_and_tree('.')
234 self.build_tree([u'\u1234A', u'\u1235A', u'\u1235AA', 'cc'])
235 self.run_bzr(['add', u'\u1234?', u'\u1235*'])
236 self.assertEquals(self.run_bzr('unknowns')[0], 'cc\n')
237
238 def test_add_with_symlink(self):
239 if not hasattr(os, "symlink"):
240 raise TestNotApplicable("Symbolic links not present")
241
242 self.make_branch_and_tree('source')
243 self.build_tree(['source/top.txt'])
244 os.symlink('source', 'link')
245 out = self.run_bzr(['add', 'link/top.txt'])[0]
246 self.assertEquals(out, 'adding top.txt\n')
247
248>>>>>>> MERGE-SOURCE