[Haskell-cafe] Q: language-c upstream repo

Ivan Zakharyaschev imz at altlinux.org
Mon Dec 21 10:12:46 UTC 2015


On Mon, 21 Dec 2015, Ivan Zakharyaschev wrote:

> Ganesh Sittampalam re-assured me at http://stackoverflow.com/a/34385874/94687
> that it is not always so bad, and gave advices that I still try to go through 
> the conversion and pushing my changes to a clone of the other upstream 
> darcs-2 repo:

> Unfortunately, it didn't go smoothly -- when pushing the converted repo, 
> darcs "couldn't commute" some tag patches, and it seems it refused to do 
> anything further:

> For now, I'm still in doubt what would be a simple way to transfer the 
> several last patches to a darcs-2 fork.
>
> Perhaps, there is some kind of a known problem with converted tags in darcs?

It looks like a bug in the darcs conversion in my case, because my 
darcs-2 result of the conversion lacks some tags, which are present in the 
darcs-1 source (and also in the hub darcs-2 repo). It's strange that the 
conversion once done for hub didn't have this problem.

~/TOOLS/prog/language-c.darcs-2 $ darcs show tags
imz_init_typos-fixed
0.4.1
0.3.1
$ cd ../language-c
~/TOOLS/prog/language-c $ darcs show tags
imz_init_typos-fixed
0.4.1
darcs_apply_bug
0.3.1
0.3
0.1
~/TOOLS/prog/language-c_hub $ darcs show tags
0.4.1
darcs_apply_bug
0.3.1
0.3
0.1

The conversion was done like this (with some warnings/error messages):

~/TOOLS/prog $ darcs convert darcs-2 language-c language-c.darcs-2
WARNING: the repository produced by this command is not understood by
Darcs 1.x, and patches cannot be exchanged between repositories in
darcs-1 and darcs-2 formats.

Furthermore, repositories created by different invocations of
this command SHOULD NOT exchange patches.

Please confirm that you have read and understood the above
by typing `I understand the consequences of my action': I understand the 
consequences of my action
lossy conversion:
merger 0.0 (
merger 0.0 (
hunk ./src/Language/C/Data/Position.hs 115
+-- | advance to the next row
+incRow :: Position -> Position
+incRow (Position o f r c) = Position o f (r + 1) c
+incRow p                  = p
hunk ./src/Language/C/Data/Position.hs 115
+{-# INLINE adjustPos #-}
+-- | adjust position: change file and line number, reseting column to 1. 
This is usually
+--   used for #LINE pragmas. The absolute offset is not changed - this 
can be done
+--   by @adjustPos newFile line . incPos (length pragma)@.
+adjustPos :: FilePath -> Int -> Position -> Position
+adjustPos fname row (Position offs _ _ _) = Position offs fname row 1
+adjustPos _ _ p                           = p
)
hunk ./src/Language/C/Data/Position.hs 115
--- | advance to the next row
+-- | advance to the next row, this does not reset the column.  use
+-- @retPos@ if that's what you want to do.
)
Finished converting.


Best regards,
Ivan


More information about the Haskell-Cafe mailing list