Commit Graph

21 Commits

Author SHA1 Message Date
Phil Cohen
28052d0586 context: add arbitraryfilectx, which can represent files outside the workdir
Move it from contrib/simplemerge so it can be re-used in the future.

Differential Revision: https://phab.mercurial-scm.org/D604
2017-09-01 11:52:20 -07:00
Phil Cohen
62cb8c7754 simplemerge: remove unused filtereddata parameter
Differential Revision: https://phab.mercurial-scm.org/D603
2017-09-01 10:35:43 -07:00
Phil Cohen
8c03c90982 simplemerge: stop accepting, and passing, file parameters
Differential Revision: https://phab.mercurial-scm.org/D381
2017-08-24 21:30:51 -07:00
Phil Cohen
cf2a7b8d40 contrib: make simplemerge script pass context-like objects
`simplemerge()` will soon require context-like objects to work. Create a simple
context-like object that wraps the requested files and can be passed to the new
API.

Differential Revision: https://phab.mercurial-scm.org/D378
2017-08-24 21:30:37 -07:00
Augie Fackler
455b926bc2 simplemerge: update to conform with modern import conventions 2017-08-22 14:13:13 -04:00
Pulkit Goyal
9523fa9b6b fancyopts: switch from fancyopts.getopt.* to getopt.*
In the next patch, we will be creating a bytes version of getopt.getopt() and
doing that will leave getopt as unused import in fancyopts. So before removing
that there are instances in codebase where instead of importing getopt, we
have used fancyopts.getopt. This patch will switch all those cases so that
the next patch can remove the import of getopt from fancyopts without breaking
things.
2016-12-06 06:27:58 +05:30
Yuya Nishihara
1d44bd2bbb ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.

ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
2016-10-22 14:35:10 +09:00
FUJIWARA Katsunori
0e48f36a63 misc: use modern exception syntax
This is fixing for 'legacy exception syntax; use "as" instead of ","'
check-code rule.

check-code has overlooked these, because files aren't recognized as
one to be checked (this problem is fixed by subsequent patch).
2016-02-10 22:44:29 +09:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Pierre-Yves David
2017698ec4 simplemerge: burn "minimal" feature to the ground
Matt Mackall said:

  The goal of simplemerge should have always been to be a drop-in
  replacement for RCS merge. Please nuke this minimization thing entirely.

This whole things is now dead.
2014-08-05 14:56:25 -07:00
Simon Heimberg
6059e06d0f cleanup: drop unused variables and an unused import 2013-07-01 20:48:56 +02:00
Mads Kiilerich
a64108eee3 tests: run check-code on Python files without .py extension 2013-04-17 03:39:36 +02:00
Adrian Buehlmann
0e6715fa28 rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
Steve Borho
83629eeaea simplemerge: use ui.warn() for warnings 2009-04-30 23:57:36 -05:00
Patrick Mezard
0d0f719f13 tests: Windows compatibility fixes
- printenv.py, md5sum.py, simplemerge, test-archive, test-merge1,
  test-merge-symlinks: set standard streams to binary mode
- test-encode: replace "gunzip" by "gzip -d"
- test-hup: requires fifo
2008-10-12 19:11:59 +02:00
Matt Mackall
346758f77c merge: move the bulk of simplemerge into core
- keep existing simplemerge command in contrib
- clean up test interface
2008-02-03 19:29:05 -06:00
Thomas Arendsen Hein
001b7980f8 Remove trailing spaces 2007-08-07 10:24:33 +02:00
Patrick Mezard
2b6cc17dd7 simplemerge: flush stdout before writing to stderr.
Besides, stderr is not always unbuffered under win32 (when redirections occur for instance), and it should be flushed too.
2007-05-06 16:40:53 +02:00
Alexis S. L. Carvalho
2fe1ec9254 polish the simplemerge command; add a test 2007-04-16 20:17:39 -03:00
Alexis S. L. Carvalho
f65315991b actually port simplemerge to hg
- use bdiff instead of patiencediff;  this is a larger change, since
  bdiff works on 2 multi-line strings, while patiencediff works on 2
  lists;

- rename the main class from Merge3 to Merge3Text and add a Merge3
  class that derives from Merge3Text.  This new Merge3 class has
  the same interface from the original class, so that the tests
  still work;

  - Merge3 uses util.binary to detect binary data and raises
    util.Abort instead of a specific exception;

- don't use the @decorator syntax, to keep python2.3 compatibility;

- the test uses unittest, which likes to print how long it took to
  run.  This obviously doesn't play too well with hg's test suite,
  so we override time.time to fool unittest;

- one test has a different (but still valid) output because of the
  different diff algorithm used;

- the TestCase class used by bzr has some extras to help debugging.
  test-merge3.py used 2 of them:

  - log method to log some data

  - assertEqualDiff method to ease viewing diffs of diffs

  We add a dummy log method and use regular assertEquals instead of
  assertEqualDiff.

- make simplemerge executable and add "#!/usr/bin/env python" header
2007-04-16 20:17:39 -03:00
Alexis S. L. Carvalho
50315bfe3b Import 3-way merge code from bzr
merge3.py is imported as contrib/simplemerge
test_merge3.py is imported as tests/test-simplemerge.py
2007-04-16 20:17:39 -03:00