Weird mercurial Graph - graph

Im trying to interpret a mercurial repository and more specific its Graph. Most of what happened is clear to me, but there are two places, where I need some help understanding what happened.
Problem A: "mq"
o changeset: 93:b0aa6f2898b6
| parent: 91:88cca7c8f32e
| user: test <test#gmail.com>
| date: Tue Feb 19 13:36:00 2019 +0100
| summary: some message
|
| o changeset: 92:0aff2e92ec57
|/ user: test <test#gmail.com>
| date: Tue Feb 12 18:10:10 2019 +0100
| summary: [mq]: 2019-02-12_18-10-04_r91+.diff
|
o changeset: 91:88cca7c8f32e
| user: test <test#gmail.com>
| date: Tue Feb 12 18:09:49002019 +0100
| summary: some message
|
Question 1: What is the meaning of changeset 92. Is this comparable to a rewinded commit in git?
Question 2: What does mq mean in this context?
Problem B: Timestamp that does not match with parent!
o changeset: 62:143401518e68
| parent: 60:327ffdb4b8c3
| user: test <test#gmail.com>
| date: Fri Nov 16 21:19:00 2018 +0100
| summary: some message
|
| o changeset: 61:b4a37ff37688
|/ user: test <test#gmail.com>
| date: Fri Nov 16 16:00:00 2018 +0100
| summary: some message
|
o changeset: 60:327ffdb4b8c3
| user: test <test#gmail.com>
| date: Fri Nov 16 18:10:00 2018 +0100
| summary: some message
|
Question 3: How do I have to interpret the timestamp of changeset 61? Should the timestamp of 61 be between the timestamps of changeset 60 and 62?
Thanks for all suggestions!

Problem A: "mq"
A1+A2: I suppose, it is commit (hg commit --mq), related to using Mercurial Queues extension, which is separate long topic of queues|patches etc. And now you try to understand repo, which used MQ, with your Mercurial without MQ extension enabled (which is tricky task)
No, mq and 0aff2e92ec57 hasn't any relation with git's rewinded commit and serve another role (I'm too lazy to repeat tutorial here)
Problem B: Timestamp that does not match with parent!
A3: As #ecm already noted, timestamps of changesets have near-zero value, because it can be changed|redefined

Related

How to Extract logs between 2 timestamps in Unix

I need to extract the logs between two timestamps from a file in Unix. I basically kind of need those logs to be copied and output in a different file so that I can copy them.
Is there an efficient way to do this? The log format looks like this - The timestamp is in a separate line from the actual logs.
Tue 21 Apr 14:00:00 GMT 2020
{"items":[{"cpu.load": "0.94","total.memory": "6039.798 MB","free.memory": "4367.152 MB","used.memory": "1672.646 MB","total.physical.system.memory": "16.656 GB","total.free.physical.system.memory": "3860.197 MB","total.used.physical.system.memory": "12.796 GB","number.of.cpus": "8"}]}
Tue 21 Apr 18:00:00 GMT 2020
{"items":[{"cpu.load": "0.76","total.memory": "6039.798 MB","free.memory": "4352.656 MB","used.memory": "1687.142 MB","total.physical.system.memory": "16.656 GB","total.free.physical.system.memory": "3858.203 MB","total.used.physical.system.memory": "12.798 GB","number.of.cpus": "8"}]}
I am doing this but it only prints out the timestamp and not the actual logs
cat file.txt | awk -F, '{ if ($1>"Fri 21 Aug 14:00:00 GMT 2020" && $1<"Sat 22 Aug 18:00:00 GMT 2020") print }'
Can someone advice.

FullCalendar - How to make a "agendaWeek" view increase the first day it displays?

Using FullCalendar with the "agendaWeek" view, I'd like the next button to increase the first day displayed by the calendar.
In other words, instead of displaying the next week when the next button is clicked, I'd like the day of the first column to increase!
Example
If the calendar displays:
Sun 6/8 | Mon 6/9 | Tue 6/10 | Wed 6/11 | Thu 6/12 | Fri 6/13 | Sat 6/14
After a click on the next button, I'd like to see :
Mon 6/9 | Tue 6/10 | Wed 6/11 | Thu 6/12 | Fri 6/13 | Sat 6/14 | Sun 6/15
Same thing when I click the previous button : I'd like the first day to become the previous one, not one week before.
Is this possible?
I found it : Generic Views.
defaultView: 'agenda',
duration: {days: 7},
dateIncrement: "24:00"

Drop 4 first columns

I have a command that can drop first 4 columns, but unfortunately if 2nd column name and 4th column name likely similar, it will truncate at 2nd column but if 2nd column and 4th column name are not same it will truncate at 4th column. Is it anything wrong to my commands?
**
awk -F"|" 'NR==1 {h=substr($0, index($0,$5)); next}
{file= path ""$1""$2"_"$3"_"$4"_03042017.csv"; print (a[file]++?"": "DETAILS 03042017" ORS h ORS) substr($0, index($0,$5)) > file}
END{for(file in a) print "EOF " a[file] > file}' filename
**
Input:
Account Num | Name | Card_Holder_Premium | Card_Holder| Type_Card | Balance | Date_Register
01 | 02 | 03 | 04 | 05 | 06 | 07
Output
_Premium | Card_Holder| Type_Card | Balance | Date_Register
04 | 05 | 06 | 07
My desired output:
Card_Holder| Type_Card | Balance | Date_Register
05 | 06 |07
Is this all you're trying to do?
$ sed -E 's/([^|]+\| ){4}//' file
April | May | June
05 | 06 | 07
$ awk '{sub(/([^|]+\| ){4}/,"")}1' file
April | May | June
05 | 06 | 07
The method you use to remove columns using index is not correct. As you have figured out, index can be confused and match the previous field when the previous field contains the same words as the next field.
The correct way is the one advised by Ed Morton.
In this online test, bellow code based on Ed Morton suggestion, gives you the output you expect:
awk -F"|" 'NR==1 {sub(/([^|]+\|){3}/,"");h=$0;next} \
{file=$1$2"_"$3"_"$4"_03042017.csv"; sub(/([^|]+\|){3}/,""); \
print (a[file]++?"": "DETAILS 03042017" ORS h ORS) $0 > file} \
END{for(file in a) print "EOF " a[file] > file}' file1.csv
#Output
DETAILS 03042017
Card_Holder| Type_Card | Balance | Date_Register
04 | 05 | 06 | 07
EOF 1
Due to the whitespace that you have include in your fields, the filename of the generated file appears as 01 02 _ 03 _ 04 _03042017.csv. With your real data this filename should appear correct.
In any case, i just adapt Ed Morton answer to your code. If you are happy with this solution you should accept Ed Morton answer.
PS: I just removed a space from Ed Morton answer since it seems to work a bit better with your not so clear data.
Ed Suggested:
awk '{sub(/([^|]+\| ){4}/,"")}1' file
#Mind this space ^
This space here it might fail to catch your data if there is no space after each field (i.e April|May).
On the other hand, by removing this space it seems that Ed Solution can correctly match either fields in format April | May or in format April|May

How to inspect the explicit dependencies of a patch in darcs?

As we know, explicit patch dependencies can be recorded by darcs record --ask-deps. (A use I see for this is preventing situations where "It's easy to move a patch that uses a feature to a point before the feature is introduced.".)
So, having a repo where I should have made such deps, I want to check whether it's true. How do I inspect the recorded explicit dependencies of a selected patch?
Google could find me some code in Darcs/UI/Commands/Rebase.hs which prints a warning if a patch had such deps, but I don't know yet if there is a stand-alone command that would just give this information (not coupled to an action):
where doAdd :: (RepoPatch p, ApplyState p ~ Tree)
=> Repository (Rebasing p) wR wU wT
-> FL (WDDNamed p) wT wT2
-> HijackT IO (Repository (Rebasing p) wR wU wT2, FL (RebaseName p) wT2 wT2)
doAdd repo NilFL = return (repo, NilFL)
doAdd repo ((p :: WDDNamed p wT wU) :>:ps) = do
case wddDependedOn p of
[] -> return ()
deps -> liftIO $ do
-- It might make sense to only print out this message once, but we might find
-- that the dropped dependencies are interspersed with other output,
-- e.g. if running with --ask-deps
putStr $ "Warning: dropping the following explicit "
++ englishNum (length deps) (Noun "dependency") ":\n\n"
let printIndented n =
mapM_ (putStrLn . (replicate n ' '++)) . lines .
renderString Encode . showPatchInfo
putStrLn . renderString Encode . showPatchInfo .
patch2patchinfo $ wddPatch p
putStr " depended on:\n"
mapM_ (printIndented 2) deps
putStr "\n"
...
Perhaps, a command that outputs a .dpatch would include this information in the dpatch. I should check this now.
Neither darcs log -v (http://bugs.darcs.net/issue959) nor darcs diff outputs this information according to my experiments.
One way is to output a .dpatch with darcs send, and look into it.
It's not a very convenient way, because
darcs send needs a target repo (even with -o FILE.dpatch);
several patches get into the bundle, instead of the single one we want to inspect...
Here is an example (I've also checked that darcs log -v doesn't give the information about the explicit dependencies):
Preparation:
$ mkdir test-darcs-deps
$ cd test-darcs-deps/
$ darcs init
$ echo a > a
$ darcs add a
$ darcs rec -m A
$ echo b > b
$ darcs add b
$ darcs rec -m B
Recording the explicit dependency:
$ echo b2 > b
$ darcs rec --ask-deps
hunk ./b 1
-b
+b2
Shall I record this change? (1/1) [ynW...], or ? for more options: y
Do you want to record these changes? [Yglqk...], or ? for more options: y
patch 1f59d082f61f1fb8d57f5f5199869d1fc21b2435
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:07 MSK 2016
* A
Shall I depend on this patch? (1/1) [ynW...], or ? for more options: y
Do you want to depend on these patches? [Yglqk...], or ? for more options: y
Finished recording patch 'B2'
Inspecting the deps (I had to refer to a non-related darcs repo in
order for darcs send to work!):
$ darcs send -o ../test-darcs-deps.dpatch
Missing argument: [REPOSITORY]
Usage: darcs send [OPTION]... [REPOSITORY]
Prepare a bundle of patches to be applied to some target repository.
See darcs help send for details.
$ darcs send -o ../test-darcs-deps.dpatch ../test-darcs
HINT: if you want to change the default remote repository to
/home/imz/tests/test-darcs,
quit now and issue the same command with the --set-default flag.
patch 1f59d082f61f1fb8d57f5f5199869d1fc21b2435
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:07 MSK 2016
* A
A ./a
Shall I send this patch? (1/3) [ynW...], or ? for more options: w
patch 151c8321b2bc36df7ba09dcab0d17c853ed31577
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:32 MSK 2016
* B
A ./b
Shall I send this patch? (2/3) [ynW...], or ? for more options: w
patch f697ac56e8241f5a906c010650b683638944ebf2
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:50 MSK 2016
* B2
M ./b -1 +1
Shall I send this patch? (3/3) [ynW...], or ? for more options: y
Do you want to send these patches? [Yglqk...], or ? for more options: l
---- Already selected patches ----
patch 151c8321b2bc36df7ba09dcab0d17c853ed31577
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:32 MSK 2016
* B
A ./b
patch 1f59d082f61f1fb8d57f5f5199869d1fc21b2435
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:07 MSK 2016
* A
A ./a
patch f697ac56e8241f5a906c010650b683638944ebf2
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:50 MSK 2016
* B2
M ./b -1 +1
---- end of already selected patches ----
Do you want to send these patches? [Yglqk...], or ? for more options: y
Minimizing context, to send with full context hit ctrl-C...
File content did not change. Continue anyway? [yn]y
The dependency can be seen in angle brackets in the output:
[B2
Ivan Zakharyaschev <imz#altlinux.org>**20160108222850
Ignore-this: e8693b796cd3cac50bb19f4458ddb323
]
<
[A
Ivan Zakharyaschev <imz#altlinux.org>**20160108222807
Ignore-this: 613cadd9266dac24e2bcd2dde97d969a
]
> hunk ./b 1
-b
+b2
Here is the full output:
3 patches for repository /home/imz/tests/test-darcs:
patch 151c8321b2bc36df7ba09dcab0d17c853ed31577
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:32 MSK 2016
* B
patch 1f59d082f61f1fb8d57f5f5199869d1fc21b2435
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:07 MSK 2016
* A
patch f697ac56e8241f5a906c010650b683638944ebf2
Author: Ivan Zakharyaschev <imz#altlinux.org>
Date: Sat Jan 9 01:28:50 MSK 2016
* B2
New patches:
[B
Ivan Zakharyaschev <imz#altlinux.org>**20160108222832
Ignore-this: 9558077a30e30ba3c99003a4418991d
] addfile ./b
hunk ./b 1
+b
[A
Ivan Zakharyaschev <imz#altlinux.org>**20160108222807
Ignore-this: 613cadd9266dac24e2bcd2dde97d969a
] addfile ./a
hunk ./a 1
+a
[B2
Ivan Zakharyaschev <imz#altlinux.org>**20160108222850
Ignore-this: e8693b796cd3cac50bb19f4458ddb323
]
<
[A
Ivan Zakharyaschev <imz#altlinux.org>**20160108222807
Ignore-this: 613cadd9266dac24e2bcd2dde97d969a
]
> hunk ./b 1
-b
+b2
Context:
Patch bundle hash:
f7ff61d69da702263b2ac613d3ca979ecab5b07b
Not quite convenient.

MS Access date diff from one row and previous row of different fields

I need to find the difference in weeks from marked Previous End Date and next Start Date.
Visit Type | Start Date | End Date | Weeks since previous visit
------------+---------------+---------------+------------------------------
Check-Up | 19-Jan-15 | 19-Feb-15 |
Check-Up | 27-Jan-15 | 27-Jan-15 | xxx
Check-Up | 22-Jan-15 | 22-Feb-15 |
Check-Up | 21-Jan-15 | 21-Jan-1 |
I need to find the diff bw 19 feb of End date and 27 jan of Start date . A simple datediff is not working. can someone help now ?

Resources