Opened on 10/28/2016 at 12:43:01 PM

Closed on 10/30/2016 at 03:35:18 PM

Last modified on 11/01/2016 at 08:30:23 AM

#4584 closed change (fixed)

ensure_dependencies: Ignore dependencies in Mercurial unconditionally

Reported by: trev Assignee: kzar
Priority: P3 Milestone:
Module: Automation Keywords:
Cc: fhd Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29360367/
https://codereview.adblockplus.org/29360531/

Description

Background

ensure_dependencies.py will add dependencies to the ignore file automatically, so that they don't appear in the status command. This is unconditional for Git, for Mercurial however we only do it if the dependency is a Git repository (Mercurial will ignore other Mercurial repositories automatically). It seems that fsmonitor extension doesn't follow the same logic however and won't ignore Mercurial repositories automatically.

What to change

Make sure to set a relative rather than absolute path to the generated ignore file (supported as of Mercurial 3.2.1). Add dependencies to that file unconditionally, regardless of repository type.

Attachments (0)

Change History (12)

comment:1 Changed on 10/28/2016 at 12:48:36 PM by fhd

  • Cc fhd added

Maybe we should add a check for the Mercurial version then, to avoid mysterious issues?

comment:2 follow-up: Changed on 10/28/2016 at 12:53:12 PM by kzar

  • Owner set to kzar
  • Priority changed from Unknown to P3
  • Ready set

Well it seems kind of unlikely someone would have a version of Mercurial that's more than two years old.

comment:3 Changed on 10/28/2016 at 12:56:28 PM by trev

I thought that maybe ensure_dependencies.py could prompt people to update Mercurial (definitely nothing beyond that) but even this seems to be non-trivial. Mercurial won't produce a clean version number, even the output of hg version --quiet needs to be parsed. IMHO that's too much effort.

comment:4 in reply to: ↑ 2 Changed on 10/28/2016 at 12:59:05 PM by trev

Replying to kzar:

Well it seems kind of unlikely someone would have a version of Mercurial that's more than two years old.

Actually, server16 (the server creating development builds, so executing ensure_dependencies.py as part of the process) runs a version of Mercurial older than 3.2.1. Not that it would run into issues because of it, it never runs hg stat...

comment:5 Changed on 10/28/2016 at 01:24:04 PM by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:6 Changed on 10/29/2016 at 08:58:05 PM by abpbot

A commit referencing this issue has landed:
Issue 4584 - Ignore Mercurial dependencies explicitly

comment:7 Changed on 10/29/2016 at 09:06:00 PM by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed

There you go Felix. (FYI dependencies are only ignored at the time that they're cloned by ensure_dependencies.py, so if you already have them cloned the script won't ignore them.)

comment:8 Changed on 10/30/2016 at 06:18:19 AM by fhd

  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks, works like a charm for the adblockbrowser repo. But there appears to be an issue with subrepos, in adblockbrowser/buildtools I get this:

$ hg status
skipping unreadable pattern file '/Users/fhd/Projects/adblockplus/adblockbrowser/buildtools/./buildtools/.hg/dependencies': No such file or directory

And indeed, the ignore.dependencies path seems wrong:

$ cat .hg/hgrc 
[paths]
default = https://hg.adblockplus.org/buildtools/

[ui]
ignore.dependencies = ./buildtools/.hg/dependencies

Should be just .hg/dependencies, or ./.hg/dependencies since that's the general pattern here.

comment:9 Changed on 10/30/2016 at 08:27:35 AM by kzar

  • Review URL(s) modified (diff)
  • Status changed from reopened to reviewing

Dang you're right. Sorry, I should have spotted this sooner.

I suspected this code never ran previously since I couldn't see how it ever could, now I suspect it never even worked previously either!

Edit: On second thought I realise I was wrong, since we used the absolute path previously it would have worked.

Last edited on 10/30/2016 at 08:52:42 AM by kzar

comment:10 Changed on 10/30/2016 at 03:29:29 PM by abpbot

A commit referencing this issue has landed:
Issue 4584 - Fix ignore file path

comment:11 Changed on 10/30/2016 at 03:35:18 PM by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed

Should work properly this time!

comment:12 Changed on 11/01/2016 at 08:30:23 AM by fhd

  • Verified working set

Yup, works just fine now!

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from kzar.
 
Note: See TracTickets for help on using tickets.