I have a file, version.txt and other files. I changed the other files, but didn't touch version.txt.
So, I've tried to push a commit, and saw a Remote heads error. (There is a changeset which modifies versions.txt file)
I did a hg pull, then hg update.
The error is: abort: crosses branches (merge branches or use --clean to discard changes)
Then I tried hg merge: abort: outstanding uncommitted changes (use 'hg status' to list changes)
But I don't undertand, why if the versions.txt isn't modified by me, why can't it just merge.
This is something I will be doing a lot, which is, develop and merge, to keep inline with the main dev repo. How can I fix this thing?
HG Status:
M printbox/web/printbox/controllers/ct_adm_colas.php
M printbox/web/printbox/controllers/ct_adm_jobs.php
M printbox/web/printbox/controllers/ct_form_configurar_cola.php
M printbox/web/printbox/core/MY_Controller.php
M printbox/web/printbox/css/estilos.css
M printbox/web/printbox/js/js_tablas_colas-jobs_ajax.js
M printbox/web/printbox/models/md_cola.php
M printbox/web/printbox/models/md_job.php
M printbox/web/printbox/views/vw_tabla_colas.php
M printbox/web/printbox/views/vw_tabla_jobs.php
A printbox/web/printbox/core/MY_Model.php
? .idea/.name
? .idea/encodings.xml
? .idea/misc.xml
? .idea/modules.xml
? .idea/printboxweb.iml
? .idea/scopes/scope_settings.xml
? .idea/vcs.xml
? .idea/workspace.xml
EIDT: Before and After following the suggested fix, the graph log looks like this:
o changeset: 19:e21fa7b131b0
| tag: tip
| parent: 17:54f59f253460
| user: JCV
| date: Tue Apr 22 12:33:36 2014 -0300
| summary: # Modificar nombre de producto para version
|
| # changeset: 18:a03eaad764cd
|/ user: Jorge S <js#fusiondev.com.ar>
| date: Wed Apr 23 16:28:01 2014 -0300
| summary: Eliminar método que no se utiliza.
|
o changeset: 17:54f59f253460
| user: Jorge S <js#fusiondev.com.ar>
| date: Mon Apr 21 17:25:23 2014 -0300
| summary: Incluir SWHelper en Printbox.php
|
# changeset: 21:1698791a9310
|\ tag: tip
| | parent: 20:3bfa1251da1b
| | parent: 19:e21fa7b131b0
| | user: Jorge S <js#fusiondev.c
| | date: Thu Apr 24 13:59:25 2014 -0300
| | summary: Merge
| |
| o changeset: 20:3bfa1251da1b
| | parent: 18:a03eaad764cd
| | user: Jorge S <js#fusiondev.c
| | date: Thu Apr 24 13:57:23 2014 -0300
| | summary: Commit de archivos
| |
o | changeset: 19:e21fa7b131b0
| | parent: 17:54f59f253460
| | user: JCV
| | date: Tue Apr 22 12:33:36 2014 -0300
| | summary: # Modificar nombre de producto
| |
| o changeset: 18:a03eaad764cd
|/ user: Jorge S <js#fusiondev.c
| date: Wed Apr 23 16:28:01 2014 -0300
| summary: Eliminar método que no se utili
|
o changeset: 17:54f59f253460
| user: Jorge S <js#fusiondev.com
| date: Mon Apr 21 17:25:23 2014 -0300
| summary: Incluir SWHelper en Printbox.php
Ok, forget about version.txt, it is not relevant here. You have 2 repos, one on your system, and the remote one.
When you tried to push the first time, you tried to send a changeset on the remote repo, and you got an error saying that you cannot push a second head, unless you issue a --force option. This is because someone else already beat you to it and pushed a changeset (modifying version.txt) on the same branch (what you call main line, is actually a branch too, and it is probably called default).
What you did next is good, you pulled the changes from the remote repo to solve the 2 heads problem. By doing so, you are the one ending up with 2 heads on the default. This is fine, it is easy to solve, we'll get to it soon.
Your current state must look like this
% hg log --graph
o changeset: 14:3cfac6413110
| tag: tip
| parent: 10:d573f47ecc2d
| summary: vb
|
| # changeset: 13:d8edfdb0532e
|/ parent: 10:d573f47ecc2d
| summary: commit to subr2
|
Now it gets complicated when you do the hg update because mercurial notices that something is wrong with your repo. You will need to fix the 2 heads issue by doing a merge, just like mercurial's suggestion.
However, doing hg merge gives you a second error, this time because you have not committed all your changes in your repo. Now you have 2 choices. You see those files with the M in front of them when you tried the hg status command? If you indeed modified them, and you want to include them in the repo, do the following:
hg commit -m "Committing remaining files"
hg merge
hg commit -m "Merge"
This is to commit the left-over changes, merge the 2 heads, then commit the merge changeset. The reason why mercurial does not want to update with uncommitted changes is for security reasons. It does not want you to loose you current work. And this brings me to the second option. If, however, the changes in the modified files are not wanted, you can discard those changes. It is possible you attempted something else during the confusion, which updated some files and left you in an in-between state. If that is the case, you can quickly discard the changes and solve the problem by doing these commands instead (loosing your changes):
hg update --clean
hg merge
hg commit -m "Merge"
The update will simply clean out the repo, and a merge will be possible. Once the merge committed, then you can issue the final push.
hg push
If you're lucky and no one pushed anything else on the remote repo, the push should succeed. Otherwise, you can pull, merge, commit and push again.
Related
I didn't think this was going to be hard but I couldn't dig up anything on how to make an org-mode clock table report include the date/time of the task. My report is like this:
#+BEGIN: clocktable :scope agenda-with-archives :timestamp "TIMESTAMP" :link nil :maxlevel 3 :tstart "<-1w>" :tend "<now>" :stepskip0 t :fileskip0 t :tcolumns 3 :narrow 110 :hidefiles t
#+CAPTION: Clock summary at [2021-01-20 Wed 10:47]
| | | <110> | | |
| File | Timestamp | Headline | Time | |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| | ALL | -Total time- | -12:36- | |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| inbox.org | | -- File time | *1:12* | |
| | | Inbox | 1:12 | |
| | | \_ Chat w/Saranya | | 0:01 |
| | [2021-01-20 Wed 10:45] | \_ Troubleshoot Cylance/3503 issue | | 1:11 |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| 01-14.org | | -- File time | *1:11* | |
| | | \_ MEETING: Build discussion/working session | | 1:11 |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| 01-18.org | | -- File time | *1:25* | |
| | | \_ MEETING: MBean registration failures in MAG DEV2 (and MAG QA2) | | 1:25 |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| 01-19.org | | -- File time | *1:55* | |
| | | \_ MEETING: nTier Bi-Weekly - Check point | | 1:00 |
| | | \_ MEETING: MBE Project Status Update Meeting - Investment and MRO | | 0:39 |
| | | \_ MEETING: Discuss problems encountered when installing package for 3503 | | 0:16 |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
| admin.org | | -- File time | *0:12* | |
| | | Admin | 0:12 | |
| | <2021-01-14 Thu 09:00 ++1w> | \_ Manage timesheet | | 0:07 |
| | <2021-01-13 Wed 09:00 ++1w> | \_ Create Deploy & Environments Meeting Agenda | | 0:05 |
|-----------------+-----------------------------+----------------------------------------------------------------------------+---------+------|
...
What I'd like is to NOT have the File column and then have some type of timestamp for each task. I've tried various special properties but I can't seem to find anything that consistently gives me a timestamp.
If I have a log entry that has a recurring schedule or an inactive timestamp outside of the property drawer then it's able to pick something up. For example, in the table above the underlying tasks had entries like this:
** WIP Troubleshoot Cylance/3503 issue :MBE:
:PROPERTIES:
:CREATED: <2021-01-20 Wed 10:46>
:END:
:LOGBOOK:
CLOCK: [2021-01-20 Wed 09:35]--[2021-01-20 Wed 10:46] => 1:11
:END:
[2021-01-20 Wed 10:45] - <snip log entry>.
...
** WIP [#B] Create Deploy & Environments Meeting Agenda
SCHEDULED: <2021-01-13 Wed 09:00 ++1w>
:PROPERTIES:
:LAST_REPEAT: [2021-01-06 Wed 09:35]
:EFFORT: 0:15
:END:
:LOGBOOK:
CLOCK: [2021-01-20 Wed 08:42]--[2021-01-20 Wed 08:47] => 0:05
<snip>
CLOCK: [2020-07-14 Tue 16:17]--[2020-07-14 Tue 16:39] => 0:22
:END:
The problem is most of my tasks are either unscheduled and/or don't have timestamps outside of the logbook. I've tried various values for the :timestamp parameter but it doesn't seem to matter.
Can anyone advise how to create a clock table with task times in a column?
Another problem I have is that even with :hidefiles it always shows the File column.
I'm still pretty new at using clock tables in org-mode, but I came across your question when I was searching for something related to org-mode the other day.
Something that might help with displaying timestamps relates to using a setting called :properties("CLOSED"). I read about this from a post by #Fabian. When this setting is used, it adds a column named "CLOSED" that should display the date-time-stamp of when a task was "CLOSED".
Before this works, however, you might need to add the following setting to your .emacs settings file first: (setq org-log-done 'time). I read about this in the org-mode documentation. When this setting is set, and if you are using the "TODO" feature in org-mode: once you set a task to "DONE", a "CLOSED" date-time-stamp should be added to your task. From there, once you refresh your clock table, this new date-time-stamp should appear in the "CLOSED" column.
Also, from playing around with the :hidefiles settings, I ran into the same problem you had where the "File" column kept showing up even with the :hidefiles setting set. My previous attempt at fixing this (in the earlier answer revision) appears to not actually be doing what I thought it was doing, so I took that part out for now. I have the feeling that this :hidefiles setting issue might be related to the version of org-mode that is being used.
Update: After trying a more recent version of org-mode (20210201), the :hidefiles setting appears to be working as expected. I installed the new org-mode version using the setting instructions from this documentation page along with the following steps.
Warning: You may want to use an older version of org-mode depending on your needs. For myself, I tried out a very recent version of org-mode (at the time of this writing), but it might be too new for your purposes. Please consider if you need to try an older version before going through the following steps if you choose to do so.
Add these lines to the .emacs file:
(require 'package)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
Open up a blank emacs editor
Type: M-x list-packages
Navigate to the org option (I picked the 20210201 option, but this might vary) so that the cursor is over the org link
Push the return/enter key
Type: C-x o
Navigate to the Install option so that the cursor is over the Install link
Push the return/enter key
Push y to continue if you want to install this
The package should install at this point
When done, exit out of emacs
Then, open up your .org file
Also: I added the following setting to my .emacs file, because I generally like to hide the various lists in my .org file when it first gets opened in org-mode:
; ref: https://orgmode.org/guide/Visibility-Cycling.html
(setq org-startup-folded t)
Here is an updated example of the settings I used in my example.org file (partly based on your original example):
#+BEGIN: clocktable :scope agenda-with-archives :properties("CLOSED") :maxlevel 3 :tstart "<-2w>" :tend "<now>" :timestamp t :hidefiles t
#+CAPTION: Clock summary at [2021-02-01 Mon 16:30]
| Timestamp | CLOSED | Headline | Time | |
|-----------------------------+------------------------+----------------------------------------------+--------+------|
| | | *Total time* | *1:17* | |
|-----------------------------+------------------------+----------------------------------------------+--------+------|
| | | topic | 1:17 | |
| | [2021-01-29 Fri 18:22] | \_ test | | 0:01 |
| [2021-01-20 Wed 10:45] | [2021-01-29 Fri 18:26] | \_ WIP Troubleshoot Cylance/3503 issue | | 1:11 |
| <2021-02-26 Fri 09:00 ++1w> | | \_ WIP [#B] Create Deploy & Environments... | | 0:05 |
|-----------------------------+------------------------+----------------------------------------------+--------+------|
|-----------------------------+------------------------+----------------------------------------------+--------+------|
#+END:
* topic
** DONE test
CLOSED: [2021-01-29 Fri 18:22]
CLOCK: [2021-01-29 Fri 18:21]--[2021-01-29 Fri 18:22] => 0:00
** DONE WIP Troubleshoot Cylance/3503 issue :MBE:
CLOSED: [2021-01-29 Fri 18:26]
:PROPERTIES:
:CREATED: <2021-01-20 Wed 10:46>
:END:
:LOGBOOK:
CLOCK: [2021-01-20 Wed 09:35]--[2021-01-20 Wed 10:46] => 1:11
:END:
[2021-01-20 Wed 10:45] - <snip log entry>.
** TODO WIP [#B] Create Deploy & Environments Meeting Agenda
SCHEDULED: <2021-02-26 Fri 09:00 ++1w>
- State "DONE" from "TODO" [2021-01-30 Sat 10:56]
:PROPERTIES:
:LAST_REPEAT: [2021-01-30 Sat 10:56]
:EFFORT: 0:15
:END:
:LOGBOOK:
CLOCK: [2021-01-20 Wed 08:42]--[2021-01-20 Wed 08:47] => 0:05
<snip>
CLOCK: [2020-07-14 Tue 16:17]--[2020-07-14 Tue 16:39] => 0:22
:END:
It's up to you if you want to take out the :timestamp t setting if adding the new "CLOSED" column.
A downside, though, with the "CLOSED" column is that I haven't found an approach that allows for scheduled tasks (that have been periodically completed) to also be shown with a date-time-stamp in the "CLOSED" column. It looks like the "SCHEDULED" setting is shown in the "Timestamp" column, but that might not be what you want.
I hope this information helps!
I am working on a Hg repo in BitBucket. I forked this repo from another main repo.
Here's my scenario:
> hg paths
default = ssh://hg#bitbucket.org/shuwnyuantee/jstock-android-as
yccheok = ssh://hg#bitbucket.org/yccheok/jstock-android-as
default repo is my forked repo. yccheok is the main repo I forked from.
I did the below so I am on drive-wealth branch of default repo.
> hg pull
pulling from ssh://hg#bitbucket.org/shuwnyuantee/jstock-android-as
> hg update drive-wealth
128 files updated, 0 files merged, 1 files removed, 0 files unresolved
> hg branch
drive-wealth
> hg log -l 3
changeset: 2770:a210525cc123
branch: drive-wealth
tag: tip
parent: 2769:a0bacd6f326a
parent: 2768:0eb8c0268784
user: Shuwn Yuan Tee <s.yuan31tee#gmail.com>
date: Tue Mar 21 16:41:04 2017 +0800
summary: merge default branch
changeset: 2769:a0bacd6f326a
branch: drive-wealth
parent: 2676:7571be00648f
user: Shuwn Yuan Tee <s.yuan31tee#gmail.com>
date: Tue Mar 21 13:17:14 2017 +0800
summary: list all accounts API
changeset: 2768:0eb8c0268784
user: Yan Cheng Cheok <yccheok#yahoo.com>
date: Sat Mar 18 13:56:51 2017 +0800
summary: Add the missing tracker name.
I wish to revert commit 2770:a210525cc123 on drive-wealth branch & push to default repo. I tried hg strip --keep -r . suggested here. Some files appear as Modified as:
> hg status
M achartengine/build.gradle
M androidXml/build.gradle
M androidlockpattern/build.gradle
M gradle/wrapper/gradle-wrapper.properties
M jstockandroid/build.gradle
M jstockandroid/src/main/AndroidManifest.xml
......
My questions are:
1) Those files show changes in Merge, but not all files are reverted correctly, many changes are missing / not undone. Any idea?
2) If (1) successfully undo all, then what are steps to proceed? What I want to achieve is => simply revert commit 2770:a210525cc123 on branch drive-wealth for default repo & push to default repo?
Thanks!
don't you need to also trip 2769?
as 2770 is your merge commit
so
hg strip --keep -r 2770
hg strip --keep -r 2769
then push
So somebody on our team moved an entire folder into a subdirectory without using hg's rename feature. The directory structure is like we need it, but the history is now gone prior to the move. It shows it as a new file when the move occurred. Numerous large merges have happened since then, and so it is not really practical to go back in time and do it right.
I have tried hg log --follow and it does not help, since hg does not know about the rename. Is there any way to manually link the files to the old removed versions after the fact, or is there some facility like the way git can infer moves and renames based on hueristics? It would be nice if there was some way to explicitly say, "this file is a continuation of this old deleted file.", even though that would still take some time to fix it all up right.
We have all but given up on ever getting that history back, but it would be really nice to have it.
You need to redo the move correctly by explicitly telling Mercurial what files were moved, then merge the broken changesets. This way you will restore the history path to the original files.
Steps, assuming <x> is the move revision, and <y> is the current head revision.
Update to the revision before the move: hg update <x-1>
Redo the move, but now correctly using hg rename or hg rename --after
Commit
Merge with the original move revision (hg merge <x>), this should have no conflicts but if there are discard all changes.
Commit
Merge with the remaining changesets after the move (if any) (hg merge <y>)
Commit
Here is the basic process shown on the command line:
$ mkdir move-merge-test
$ cd move-merge-test
$ hg init
$ echo "x" > a
$ hg add a
$ hg commit -m "initial revision"
Move incorrectly:
$ mv a b
$ hg remove a
$ hg add b
$ hg status --copies
A b
R a
$ hg commit -m "incorrect move"
$ hg log --follow b
changeset: 1:b22f3e94133b
tag: tip
user: Laurens Holst <...>
date: Wed Oct 19 14:41:37 2011 +0200
summary: incorrect move
Correct the move:
$ hg update 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg rename a b
$ hg status --copies
A b
a
R a
$ hg commit -m "correct move"
created new head
$ hg log --follow b
changeset: 2:5deabbcb5480
tag: tip
parent: 0:b82f89f0c7d9
user: Laurens Holst <...>
date: Wed Oct 19 14:46:35 2011 +0200
summary: correct move
changeset: 0:b82f89f0c7d9
user: Laurens Holst <...>
date: Wed Oct 19 14:36:35 2011 +0200
summary: initial revision
Merge it with the broken move:
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -m "merge with broken move"
$ hg log --follow b
changeset: 3:ce65fc7b35e4
tag: tip
parent: 2:5deabbcb5480
parent: 1:b22f3e94133b
user: Laurens Holst <...>
date: Wed Oct 19 14:47:13 2011 +0200
summary: merge broken branch
changeset: 2:5deabbcb5480
parent: 0:b82f89f0c7d9
user: Laurens Holst <...>
date: Wed Oct 19 14:46:35 2011 +0200
summary: correct move
changeset: 1:b22f3e94133b
user: Laurens Holst <...>
date: Wed Oct 19 14:41:37 2011 +0200
summary: incorrect move
changeset: 0:b82f89f0c7d9
user: Laurens Holst <...>
date: Wed Oct 19 14:36:35 2011 +0200
summary: initial revision
As you can see, the history now correctly shows all affected changesets. If the files are moved in several commits, the basic principle stays the same just merge across more than just 1 commit. If you have any commits made after the move, I recommend to merge them in separately (step 6 in the steps above) in order to avoid spurious conflicts.
I had good luck with this kind of thing by deleting the new (the "moved") file, then going back to a revision when the file was still in place, doing the move properly (including commit) and merging the two heads.
There's a --after option to hg rename which lets you tell Mercurial about a rename after the fact, but it has to be done before you commit the rename.
You could try doing hg convert on the repository and specify the --filemap parameter, which will let you rename a files and directories.
https://www.mercurial-scm.org/wiki/ConvertExtension#A--filemap
In git, I can use git log --stat to see which files changed in a commit. How can I do that in bzr?
$ git log --stat
commit dbdc98ccc1ce12a31a0bf29173b4990ccbff98
Author: Me <Me#Me.com>
Date: Thu Jan 29 19:03:10 2011 -0800
Add snipMate v0.83
vim/after/plugin/snipMate.vim | 35 ++
vim/autoload/snipMate.vim | 433 ++++++++++++++++++++++++++
vim/doc/snipMate.txt | 286 +++++++++++++++++
bzr viz doesn't show changed files either.
bzr log --verbose will list the files under a modified: header.
Also, bzr help and bzr help <command> are helpful.
I'm actually trying something simple, but I get strange results:
I want to compare the current version of a file with a specific revision.
In NetBeans 6.9.1 I didn't find any such function. I can only call the history and then diff between successive revisions. Am I missing something?
I tried with the command line tool (Linux):
hg diff --rev 527 pom.xml
But I get:
diff -r 1018d7890ea1 pom.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pom.xml Sun Jan 30 22:45:28 2011 +0000
## -0,0 +1,167 ##
+
followed only by "+" lines.
How can I get the diff I want? How can I get this diff with NetBeans (or otherwise with another graphical diff tool)?
You usage of the command-line tool looks correct. However the output
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
Indicates that the file you want to diff did not yet exist in the revision you chose.
Addendum:
In the comments you mention the file was renamed and you need to use -g
You can enable -g for all diffs by adding:
[diff]
git=1
to your .hgrc file (usually located in your home directory)
hg diff -r revision1:revision2 file
Where revision1 and revision2 can be a tag, changeset etc.
By default, your revision2 should be "tip" (without quotes) if you want to compare a revision to the current one.