Frej Drejhammar
64ee34dfb0
Merge branch 'PR/303' into frej/felipec-pr-spree
...
Closes #303
Closes #304
2023-03-27 20:34:17 +02:00
Frej Drejhammar
71834a584c
Merge branch 'PR/302' into frej/felipec-pr-spree
...
Closes #302
2023-03-27 20:33:59 +02:00
Frej Drejhammar
4310e47760
Merge branch 'PR/301' into frej/felipec-pr-spree
...
Closes #301
2023-03-27 20:33:36 +02:00
Felipe Contreras
90c6ad5f87
test: use make to run the tests
...
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-26 20:05:03 -06:00
Felipe Contreras
51db3b4236
test: update default location of sharness
...
It's included as a module for a reason.
Also, use "$0" so the tests can be run like `./t/main.t` (or any other
directory).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-26 20:04:38 -06:00
Felipe Contreras
fba03b95fb
github: update checkout action
...
Gets rid of the warning:
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ .
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-26 19:46:38 -06:00
Felipe Contreras
2cc7db7556
test: bump sharness to 1.2
...
It's finally released.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-26 19:43:04 -06:00
Frej Drejhammar
a89033b5b1
Merge branch 'PR/299' into frej/sharness-as-submodule-and-smoke-test
...
Closes #298
Closes #299
2023-03-26 18:40:52 +02:00
Frej Drejhammar
fd5bd48a6c
Update codeql to version 2
2023-03-26 16:48:07 +02:00
Frej Drejhammar
84a877d112
Add smoke tests to CI test suite
...
The added test is an unpublished test, now ported to Sharness, which
has been used by the maintainer to sanity check PRs.
2023-03-26 16:48:07 +02:00
Frej Drejhammar
3f57c4340a
Change CI to run tests using test runner
2023-03-24 18:46:53 +01:00
Frej Drejhammar
1e872eb235
Add primitive test runner
2023-03-24 18:11:37 +01:00
Frej Drejhammar
ecdbf0e42e
Add Sharness as a submodule
2023-03-24 17:22:23 +01:00
Felipe Contreras
9754a9f3f6
Trivial simplification
...
Just return the values directly, no need to store them into variables.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
d2f11bd619
Remove multiple parent logic for file changes
...
This is already what repo.status does.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
3582221efd
Compare changes only with the first parent
...
It's not necessary to check both parents.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
0ae0d20496
Remove no-op check
...
This code is only executed when there's two parents.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
e09a14a266
Move parents logic inside get_filechanges
...
This way export_commit is much simpler (already quite complex), and it's
easier to modify the logic.
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
9df2f97f6c
Rename variables in get_filechanges
...
It's easier to understand this way.
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
531fa9b3a2
Simplify split_dict
...
There's no need to keep track of the left side: if it's modified it's
modified.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
a229b39d66
Coalesce modified files
...
Git doesn't care if they are added or changed: they are modified.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
c666fd9c95
Trivial style cleanup
...
Checking the array directly is more idiomatic.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
21fa443b4a
Simplify list of files for the first commit
...
We already have the files.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-14 22:12:50 -06:00
Felipe Contreras
fd6ba361c6
github: enable tests
...
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-13 20:18:29 -06:00
Felipe Contreras
153ba2a5c1
Add main test
...
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-13 20:18:29 -06:00
Frej Drejhammar
df5278f755
Merge branch 'PR/297'
...
Closes #297
2023-03-13 17:57:20 +01:00
Felipe Contreras
6fbe4d0ad0
Skip earlier
...
Now that we have ctx easily available, skip early.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-10 12:38:42 -06:00
Felipe Contreras
fa73d8dec9
Share the changectx more
...
It's used everywhere, might as well pass it along.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-10 12:38:30 -06:00
Felipe Contreras
e1e15b2091
Avoid revsymbol()
...
We can just do repo[rev].
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
534d2bdd92
Don't deal with the node in get_changeset()
...
It's not necessary.
It could be fetched with repo[rev].node(), but why bother?
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
23f41c0ff1
Use revision directly instead of revnode
...
We don't need the revnode.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
8b1fd408ca
Use changectx directly
...
There's no need to call repo[revnode] when repo[rev] works perfectly
fine.
And since we have the context already we can just do ctx.hex() instead
of hexlifying ourselves.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
4a4d242e98
Fetch node directly
...
No need to call get_changeset() for that.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
432254100b
Fetch branch names directly
...
No need to use get_changeset() for just one thing.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
5e4bc6eb03
Remove cruft
...
Nothing uses that variable.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Felipe Contreras
7886016978
hg2git: set proper default branch
...
So that cfg_master is picked up in get_branch().
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-09 19:48:44 -06:00
Frej Drejhammar
18577f559d
Merge branch 'PR/296'
2023-03-04 20:21:29 +01:00
Felipe Contreras
88defe7fd1
README: cleanup initial instructions
...
The `git init` command can create the directory, and HEAD doesn't need
to be specified in `git checkout` (it's the default).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-04 09:53:25 -06:00
Frej Drejhammar
4edea927fb
Merge branch 'PR/295'
...
Closes 295
2023-03-04 16:12:26 +01:00
Felipe Contreras
bbab981130
Trivial simplification of wr
...
No need to issue two write commands.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-04 16:08:45 +01:00
Felipe Contreras
c3cbf1e04d
Add wr_data helper
...
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-03 19:34:29 -06:00
Felipe Contreras
4c10270302
Fix data handling
...
The length should be exactly the same as the data, for example if the
data is "hello" only 5 characters should be written on the stream. Thus
it should always be `len(data)`, not `len(data)+1` as it currently is in
some places.
Since the first commit of hg2git.py there was a wtf comment, presumably
Rocco was confused about this common discrepancy.
We can shuffle the logic around by adding '\n' to the data, and removing
+1 to the length.
Also, the data should be written without a newline (wr_no_nl).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com >
2023-03-03 19:33:45 -06:00
Frej Drejhammar
723d8032ba
Merge branch 'PR/294'
2022-11-25 16:31:18 +01:00
df
268299a358
Fix typo in README
...
Added dash to match the actual usage of the 'ignore-unnamed-heads' option
2022-11-19 18:15:04 +01:00
Frej Drejhammar
6700b164d0
Merge branch 'PR/293'
...
Closes #292
v221024
2022-10-23 14:47:04 +02:00
chrisjbillington
13c273f10c
Resolve unicode escape sequences not being processed correctly
...
In `process_unicode_escape_sequences()`, any backslash escape sequences
in the original string are escaped upon the first
`.encode('unicode-escape')` and therefore round-trip the sequence of
`.encode('unicode-escape').decode('unicode-escape')`.
That is not what we want - we want these sequences to be passed-through
the `.encode` unchanged, so that they will be converted to the
character they represent upon `.decode()`.
This patch changes the `.encode()` step to pass through any ascii
characters unchanged, only escaping non-ascii characters. This ensures
any existing backslash escape sequences will be interpreted as the
character they represent upon `.decode()`.
2022-10-23 11:51:33 +11:00
Frej Drejhammar
667404e836
Merge branch 'PR291'
v220921
2022-09-21 18:31:16 +02:00
Nicolas Vanhoren
38e236962d
Update README.md to change recommandation for crlf filtering
2022-09-21 01:37:39 +02:00
Frej Drejhammar
dbb8158527
Merge branch 'frej/submodule-doc-improvement'
2022-02-10 20:05:07 +01:00
Frej Drejhammar
bb0bcda7ba
Merge branch 'frej/fix-re-future-warning'
2022-02-10 20:04:14 +01:00